4 ms·
You can generate JSON Schema from TS with this library: https://github.com/YousefED/typescript-json-schema https://github.com/YousefED/typescript-json-schema I
by colinmcd 7y ago
You can generate JSON Schema from TS with this library: https://github.com/YousefED/typescript-json-schema https://github.com/YousefED/typescript-json-schema
It's certainly conceivable to build an equivalent for Zod but you'll eventually want to validate types that aren't expressible in TS (i.e. Integer).
- IggleSniggle 7y agoThis looks like it generates JSON Schema, but not runtime validators?
- coffexx 7y agoFor that you could use something like ajv. Json schema has the advantage of being usable across different languages, but it does come with the overhead of maintaining those files and keeping it in sync with your other repos.