-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
[BUG][PHP] Code unreachable for responses other than 2xx and bad return types #7788
Labels
Comments
Any update on this? Current solution is awkward
|
same problem, have commented out:
and also on $apiInstance put off http errors off: |
5 tasks
wing328
pushed a commit
that referenced
this issue
Oct 7, 2024
…ue 7788 (#19483) * in case of defined status codes > 299 switch will have no effect. As described in issue 7788 so we get only an error if statusCode is not defined AND not between 200 and 299 #7788 * in case of defined status codes > 299 switch will have no effect. As described in issue 7788 so we get only an error if statusCode is not defined AND not between 200 and 299 #7788
closed via #19483 thanks for the PR by @kruegge82 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
The generated PHP code (
case 400:
) is unreachable when a response with HTTP code 400 is defined. It adds that return type to the PHPdoc but it's never returned as the RequestException is caught for anything different than a 2xx.Tools like Psalm will expect a return type that will never be returned.
openapi-generator version
v5.0.0-beta2
OpenAPI declaration file content or url
Generation Details
config.json
Steps to reproduce
Generate the client with a model defined for a response different than 2xx
Related issues/PRs
Suggest a fix
The text was updated successfully, but these errors were encountered: