Our great sponsors
-
Having said that: I prefer, and really love, zod. It's a high-quality library (there's some "clones" that may be slightly faster, but the code quality is very low). It's intuitive and easy to use. Relatively lightweight. It's schema-first, though: meaning, you define the schema in zod, and it infers your types from the schema. So if you want to generate schemas from types, then you'll need to look elsewhere.
-
Take a look at tiny-schema-validator . Totally not sponsered
-
Klotho
AWS Cloud-aware infrastructure-from-code toolbox [NEW]. Build cloud backends with Infrastructure-from-Code (IfC), a revolutionary technique for generating and updating cloud infrastructure. Try IfC with AWS and Klotho now (Now open-source)
-
ajv
The fastest JSON schema Validator. Supports JSON Schema draft-04/06/07/2019-09/2020-12 and JSON Type Definition (RFC8927)
You then turn that spec into runtime validators. For example, AJV- (JSON Schema validator)
Related posts
- How can we map data from JSON to typescript object efficiently?
- Fastify: Support for Auto Type Inference (similar to TRPC)
- Typescript Runtime Validators and DX, a type-checking performance analysis of zod/superstruct/yup/typebox
- TypeScript-JSON is 10 ~ 1,000x times faster than ZOD and IO-TS
- I tried Typescript for 1 year ...