-
-
Notifications
You must be signed in to change notification settings - Fork 350
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: only generates 200 response bodies #1380
Comments
Similar to this issue: #1280 |
Isn't this https://orval.dev/reference/configuration/output#generateeachhttpstatus The setting to generate for each HTTP status? |
@melloware That is a config option for the mocks, and it does not affect zod generation as far as I can tell. |
Reopened i thought it did it for mocks and zod. I see now its just mocks. |
You are right the code is only doing 200 const response = spec?.[verb]?.responses?.['200'] as
| ResponseObject
| ReferenceObject; |
@Priddles is it just a matter of looping over the responses array and generating for each? |
Yes, I'd say so. Some level of deduplication would be good, but definitiely a nice-to-have. |
@melloware I have a fix for this locally and will put a PR in tomorrow. |
Ok assigned the ticket to you. |
@melloware @TommoLeedsy Thanks for the quick turnaround! I saw it got released so I tried it out, but having some issues. Wasn't sure whether to open a new issue or not so putting it here. I have a minimal reproducible example here. The issues are:
|
I would open a new ticket. |
@Priddles Sorry yeah that's my mistake, I didn't realise I needed to add a new config option and just used an existing one instead. I have now added |
Yes @TommoLeedsy PR would be great. |
@melloware Do you know when the fix might be released? |
Let me find out |
Working in latest release. Thanks! 🎉 |
What are the steps to reproduce this issue?
Example
What happens?
Only one Zod schema for the 200 response body is generated.
What were you expecting to happen?
Zod schemas for all possible responses to be generated.
Any logs, error output, etc?
None.
Any other comments?
Appears to be hard-coded:
What versions are you using?
Operating System: MacOS 14.4.1
Package Version: 6.28.2
Browser Version: N/A
The text was updated successfully, but these errors were encountered: