Closed ryan0x44 closed 2 months ago
I'm not sure how you'd approach annotating the zod schema with the necessary data
That's the issue, there is no canonical way of doing this. Maybe in v4, I guess we'll see
Try the nameStrategy or override options.
I'm not sure how you'd approach annotating the zod schema with the necessary data, but it would be great to be able to set the
title
field on the JSON Schema object.e.g.
"title": "TitleHere",
in the context of zod-to-json-schema README 'Expected output' example:Currently I use the Zod
.describe()
method to set the description, then do a find and replace on the JSON Schema output for the "description" field, which is very hacky and preclude me from using the description field.Official JSON Schema docs about annotations such as
title
can be found here: https://json-schema.org/understanding-json-schema/reference/annotations