Hey HN,<p>We're designing a new system and have been kicking the can about JSON object definitions and validation. Soon we need to settle on a system to validate API request bodies and provide helpful error messages. We would also like to generate Typescript types.<p>In the past, I've used JSON Schema ( https://json-schema.org/ ) to define definitions and ajv ( https://ajv.js.org/ ) to validate, but it's a bit verbose and ajv validation errors are more cryptic than I'd like to deal with.<p>TypeSchema looks interesting. It seems solid (and perhaps stable?), but development hasn't been active for 2 years. It also looks like we'd still need to generate JSON Schema and choose a validation library<p>Anyway, I'm very curious how others are approaching this problem. How do you organize and generate validations for your type definitions? What libraries do you use to validate and provide human readable error messages?<p>Thank you!
There's a new spec, JSON Type Definition [1], but I don't have any experience using it.<p>[1] <a href="https://jsontypedef.com/" rel="nofollow">https://jsontypedef.com/</a>