Replies: 1 comment
-
|
Hey! I'm Dosu, a bot trained on Zod's codebase and issues. I can help shed light on this. The
You're right that the boolean form is the older Draft 4 convention. The union type exists so the same TypeScript interface can represent output for any target draft. If you want to ensure you only get the modern numeric form, you can set the import { z } from "zod/v4";
z.toJSONSchema(schema, {
target: "draft-2020-12" // or "draft-07"
});With As for the TypeScript type definition itself ( Feel free to close this discussion if that answers your question! To reply, just mention @dosu. Docs are dead. Just use Dosu. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
According to the https://json-schema.org/understanding-json-schema/reference/numeric documentation,
booleanseems to be an older Draft 4 convention. Is there a way in Zod to removebooleanfrom it?Beta Was this translation helpful? Give feedback.
All reactions