-
Notifications
You must be signed in to change notification settings - Fork 100
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] generateSchema creates incorrect schema type #192
Comments
Same problem here. The change was introduced in 2.2.5. Works with version 2.2.4. For example the parseObject function in zod-openapi.ts now returns |
Try to use openAPI version 3.1.0 |
Hey, I just encountered this issue as well. Fortunately I was able to catch it. But it is a pretty significant change to introduce in a patch version bump. At the same time I want to say that I'm otherwise very happy with these packages, and it has helped us a lot! So no shadow upon the maintainers, I know the struggle! I just want to know the reasoning behind change and what we need to do to handle it on our end, if there is anything? I'm not really sure what @kerolloz mean with testing openAPI v3.1.0? The code example in this repo ( I'm happy to provide a PR with some kind of fix if it would be appreciated! |
I see the changes were introduced in #173. And after reading thru the discussions I understand the desire from some teams to use this. But at the same time I wonder if there's anything that could be done to support multiple version maybe? Or maybe revert this for the 2.2 version line and release it in v3 (or if need be v2.3.0)? |
generateSchema creates incorrect schema type:
according to specification type field:

generated schema type field as array:

swagger reports unknown type field:
used versions:
"@anatine/zod-openapi": "^2.2.0",
"zod": "^3.22.4",
"@fastify/swagger": "^8.14.0",
"@fastify/swagger-ui": "^3.0.0"
node v21.2.0
The text was updated successfully, but these errors were encountered: