Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
April 22, 2023 03:00 pm GMT

Fastest Way to Auto Generate Types for Typescript and Input validation

Short description

Writing types for API's especially giant JSON's are frustrating especially when it comes to input validation.

solution:

Just paste your json inside app.quicktype.io or it's vscode

Image description

Now you can paste that type into transform.tools/typescript-to-zod to generate the corresponding zod schema for input validation:

Image description

Note For Practical step by step example check this 4min youtube video:

Skip Writing types manually

Github Project


Original Link: https://dev.to/seyyedkhandon/fastest-way-to-auto-generate-types-for-typescript-and-input-validation-478p

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To