-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
zod-openapi outputting invalid OpenAPI specs when using 'nullable' #228
Comments
We've gotten around this by doing |
Same with me. Another way is |
We've reverted to Changing all of our schemas which had v2.2.1 with .nullable() {
"field": {
"type": "boolean",
"nullable": true
}
} v2.2.6 after changing to .or(z.null()) {
"field": {
"oneOf": [
{
"type": "boolean"
},
{
"type": "null"
}
]
}
} |
Hello,
I've just started using this library and have come across the following issue. Consider the following:
The Swagger UI looks like this:
And the JSON / Yaml it generates looks like this:
Not sure if this is a known bug, or whether I'm somehow doing something wrong?
In case it's relevant, I am using this within a Nest.js application, so the Swagger docs are being generated as per the documentation:
Thank you in advance.
The text was updated successfully, but these errors were encountered: