-
Notifications
You must be signed in to change notification settings - Fork 130
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
Default responses lead to invalid Swift code #530
Comments
The generated code respects the order specified in your OpenAPI document. Let me take a look though, we should at least move the default case to the end. A temporary workaround is to move the default case in the OpenAPI doc. |
Well we already have some logic to try to do this, but if you're seeing it not work, then it's likely broken. If you'd like to open a PR fixing this that'd be much appreciated 🙏 |
Hey @czechboy0 👋🏼 |
### Motivation I couldn't reproduce the issue #530 on my end. However, I noticed that there were no tests, so I would like to add them. ### Modifications Adding tests. ### Result Only adding tests, no change in the behavior of the library. ### Test Plan Added tests are passing. Co-authored-by: Honza Dvorsky <[email protected]>
@pepicrft So I think you might be using an outdated fork here?
I just tested your snippet on main and it works correctly. Also thanks @mt-hodaka for adding a snippet test in #554. Please reopen the issue if you can still reproduce it on the latest version, thanks! |
Description
When using default responses in the OpenAPI schema, the generated code for the client places the
default
case at the top of theswitch
, and the compiler yields an errorAdditional 'case' blocks cannot appear after the 'default' block of a 'switch'
.Reproduction
Package version(s)
Expected behavior
I'd expect the
default
to be at the bottom.Environment
Additional information
No response
The text was updated successfully, but these errors were encountered: