Replies: 1 comment
-
Hi @camroots , glad you're using the lib and you're happy with it. How do you envision this snake case to camel case conversion working? Since we're just generating the OpenAPI docs based on the zod schemas, we're not performing any validation and the HTTP requests don't pass through our lib. So even if we have an option to convert the casing in the docs, that would only have the labels in the docs different from what is actually expected. I guess you need some sort of ZodSchema-to-ZodSchema translator which would convert the fields after the transformation, but that's what you're already doing. Unfortunately I don't see how that can be done in zod-to-openapi |
Beta Was this translation helpful? Give feedback.
-
Hi 👋 thanks for the great tool, my team is using it with our express API.
We have requirements to use snake case for the request and response payloads. To make
zod-to-openapi
work for this, we are currently defining our schemas using snake case and then have some conditioning done after parsing to convert to the payloads to camel case.If would be great if
zod-to-openapi
could perform this conversion, then our schemas could be created using camel case. Would this be functionality you would consider adding? I would be happy to contribute a PR.Thanks!
Beta Was this translation helpful? Give feedback.
All reactions