Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: add types for built-in schemas and envelopes #1837

Closed
1 of 2 tasks
am29d opened this issue Jan 5, 2024 · 2 comments · Fixed by #1838
Closed
1 of 2 tasks

Feature request: add types for built-in schemas and envelopes #1837

am29d opened this issue Jan 5, 2024 · 2 comments · Fixed by #1838
Assignees
Labels
completed This item is complete and has been merged/shipped feature-request This item refers to a feature request for an existing or new utility parser This item relates to the Parser Utility tests PRs that add or change tests

Comments

@am29d
Copy link
Contributor

am29d commented Jan 5, 2024

Use case

When using zod schema we can extract type from the schema:

import { z } from 'zod';

const orderSchema = z.object({
  id: z.number().positive(),
  description: z.string(),
  items: z.array(orderItemSchema),
});

type Order = z.infer<typeof orderSchema>; 

We have created built-in schemas and envelopes but we did not extracted this types into dedicated package. If users want to use the types from the schema they need to write z.infer statement themselves. We can improve the experience by creating this types.

Solution/User Experience

Write a types file with alle the schema and envelopes types using z.infer

Alternative solutions

No response

Acknowledgment

Future readers

Please react with 👍 and your use case to help us understand customer demand.

@am29d am29d added triage This item has not been triaged by a maintainer, please wait feature-request This item refers to a feature request for an existing or new utility labels Jan 5, 2024
@am29d am29d added this to the Parser - Beta Release milestone Jan 5, 2024
@am29d am29d added tests PRs that add or change tests parser This item relates to the Parser Utility and removed triage This item has not been triaged by a maintainer, please wait labels Jan 5, 2024
@am29d am29d moved this from Triage to Working on it in Powertools for AWS Lambda (TypeScript) Jan 5, 2024
@am29d am29d self-assigned this Jan 5, 2024
@dreamorosi dreamorosi moved this from Working on it to Next iteration in Powertools for AWS Lambda (TypeScript) Jan 30, 2024
@dreamorosi dreamorosi linked a pull request Mar 6, 2024 that will close this issue
9 tasks
@github-actions github-actions bot added the pending-release This item has been merged and will be released soon label Mar 6, 2024
@dreamorosi dreamorosi moved this from Next iteration to Shipped in Powertools for AWS Lambda (TypeScript) Mar 6, 2024
@dreamorosi dreamorosi added completed This item is complete and has been merged/shipped and removed pending-release This item has been merged and will be released soon labels Mar 6, 2024
@github-project-automation github-project-automation bot moved this from Shipped to Coming soon in Powertools for AWS Lambda (TypeScript) Apr 4, 2024
Copy link
Contributor

github-actions bot commented Apr 4, 2024

⚠️ COMMENT VISIBILITY WARNING ⚠️

This issue is now closed. Please be mindful that future comments are hard for our team to see.

If you need more assistance, please either tag a team member or open a new issue that references this one.

If you wish to keep having a conversation with other community members under this issue feel free to do so.

@dreamorosi dreamorosi moved this from Coming soon to Shipped in Powertools for AWS Lambda (TypeScript) Apr 18, 2024
@dreamorosi
Copy link
Contributor

This is now released under v2.1.0 version!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completed This item is complete and has been merged/shipped feature-request This item refers to a feature request for an existing or new utility parser This item relates to the Parser Utility tests PRs that add or change tests
Projects
Development

Successfully merging a pull request may close this issue.

2 participants