3 ms·
Zod to JSON schema is a thing so I think that solves your problem, no? https://www.npmjs.com/package/zod-to-json-schema https://www.npmjs.com/package/zod-to-js
by vlovich123 4y ago
Zod to JSON schema is a thing so I think that solves your problem, no?
https://www.npmjs.com/package/zod-to-json-schema https://www.npmjs.com/package/zod-to-json-schema
- tmerse 4y agoYou happen to know if there are libs/utils to achieve the reverse (JSON-schema -> zod)? Could be useful for one of my usecases (form validation via rules recievd as JSON)
- evv 4y agoI didn't know about this! But on the client I would use a JSON-schema validator anyways, otherwise I'd need something like "json-schema-to-zod"? Seems like a roundabout way to address my problem