Closed
Description
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
- This feature request meets Powertools for AWS Lambda (TypeScript) Tenets
- Should this be considered in other Powertools for AWS Lambda languages? i.e. Python, Java, and .NET
Future readers
Please react with 👍 and your use case to help us understand customer demand.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Shipped