5 ms·
Zod 4 supports converting a Zod schema to JSON-Schema (natively, this has always been possible with 3rd-party libs). One key difference is preprocessing/refine
by 0x62 1y ago
Zod 4 supports converting a Zod schema to JSON-Schema (natively, this has always been possible with 3rd-party libs).
One key difference is preprocessing/refine. With Zod, you can provide a callback before running validation, which is super useful and can't be represented in JSON. This comes in handy more often than you'd think - e.g converting MM/DD/YYYY to DD/MM/YYYY before validating as date.
- silverwind 1y agoDoes it support the other way around too? I'd live to ditch AJV.