-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
[PHP] Fix deserialize ApiException as a Model #757
[PHP] Fix deserialize ApiException as a Model #757
Conversation
Please note that this is a port of a PR from swagger-codegen#7968 This PR takes account of previous code reviews and takes another approach:
I successfully tested this PR against multiple response types ( |
I've added a fix for the "petstore-security-test" sample. |
https://app.shippable.com/github/OpenAPITools/openapi-generator/runs/2088/1/console
@ymilin Could you run /bin/openapi3/php-petstore.sh? |
@ackintosh Thanks, just added a new commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thanks!
@ymilin thanks again for the PR, which is included in the v3.3.0 minor release: https://twitter.com/oas_generator/status/1046941449609068544 |
* [PHP] Fix deserialize for default responses. Update samples * [PHP] Update sample files * Fix the distination ("-o") of petstore-security-test * Clean up "petstore-security-test" folder * Update petstore-security-test sample files * Update petstore OpenAPI3 sample files
Issue already patched in OpenAPI Gen OpenAPITools/openapi-generator#757
PR checklist
./bin/
to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh
and./bin/security/{LANG}-petstore.sh
if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\
.master
,4.0.x
. Default:master
.Description of the PR
When defining
default
responses (ApiException
) as a Schema Object in Swagger declaration files, the current implementation cannotdeserialize
the Model properly intoApiException::$responseObject
.Added a check for
$returnType
andjson_decode
appropriately (same logic as the try part of same function for success responses)fix #756