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

Now you can paste that type …


This content originally appeared on DEV Community and was authored by DX Knight

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


This content originally appeared on DEV Community and was authored by DX Knight


Print Share Comment Cite Upload Translate Updates
APA

DX Knight | Sciencx (2023-04-22T15:00:12+00:00) Fastest Way to Auto Generate Types for Typescript and Input validation. Retrieved from https://www.scien.cx/2023/04/22/fastest-way-to-auto-generate-types-for-typescript-and-input-validation/

MLA
" » Fastest Way to Auto Generate Types for Typescript and Input validation." DX Knight | Sciencx - Saturday April 22, 2023, https://www.scien.cx/2023/04/22/fastest-way-to-auto-generate-types-for-typescript-and-input-validation/
HARVARD
DX Knight | Sciencx Saturday April 22, 2023 » Fastest Way to Auto Generate Types for Typescript and Input validation., viewed ,<https://www.scien.cx/2023/04/22/fastest-way-to-auto-generate-types-for-typescript-and-input-validation/>
VANCOUVER
DX Knight | Sciencx - » Fastest Way to Auto Generate Types for Typescript and Input validation. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2023/04/22/fastest-way-to-auto-generate-types-for-typescript-and-input-validation/
CHICAGO
" » Fastest Way to Auto Generate Types for Typescript and Input validation." DX Knight | Sciencx - Accessed . https://www.scien.cx/2023/04/22/fastest-way-to-auto-generate-types-for-typescript-and-input-validation/
IEEE
" » Fastest Way to Auto Generate Types for Typescript and Input validation." DX Knight | Sciencx [Online]. Available: https://www.scien.cx/2023/04/22/fastest-way-to-auto-generate-types-for-typescript-and-input-validation/. [Accessed: ]
rf:citation
» Fastest Way to Auto Generate Types for Typescript and Input validation | DX Knight | Sciencx | https://www.scien.cx/2023/04/22/fastest-way-to-auto-generate-types-for-typescript-and-input-validation/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.