Skip to content
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

Output vs Input Schemas #295

Open
sepirak-nick opened this issue Mar 10, 2025 · 0 comments
Open

Output vs Input Schemas #295

sepirak-nick opened this issue Mar 10, 2025 · 0 comments

Comments

@sepirak-nick
Copy link

Hi,

We use this library to generate both input and output schemas for our API definition. However, we run into issues when we have a Zod schema that uses .default(). The output OpenAPI schema marks the field as "optional", but since we're using it as a response value it should always be defined.
Is there some way to use the same Zod schema, and pass in some kind of .openapi() option to tell the generator to use the Zod output, not input?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant