[python] Fixes a breakage while deserializing the read-only attributes#10155
[python] Fixes a breakage while deserializing the read-only attributes#10155spacether merged 15 commits intoOpenAPITools:masterfrom
Conversation
Merge upstream fixes
update with upstream master
…tor into feature/refresh_master
regular merge code from upstream
|
cc @taxpon (2017/07) @frol (2017/07) @mbohlool (2017/07) @cbornet (2017/09) @kenjones-cisco (2017/11) @tomplus (2018/10) @Jyhess (2019/01) @arun-nalla (2019/11) @spacether (2019/11) |
|
@vvb thanks for the PR. Can you please add a test using |
modules/openapi-generator/src/main/resources/python/model_utils.mustache
Outdated
Show resolved
Hide resolved
|
@spacether @wing328 I have taken care of the comments. I have also added a test that checks for this issue and attached snapshots of it passing against this branch, and failing against master (which does not have the fix yet). Please check and update if anything more is required here. |
modules/openapi-generator/src/main/resources/python/model_utils.mustache
Outdated
Show resolved
Hide resolved
samples/openapi3/client/petstore/python/tests_manual/test_issue10155.py
Outdated
Show resolved
Hide resolved
spacether
left a comment
There was a problem hiding this comment.
Thank you for your PR. This looks great! Can you make the suggested small tweaks to:
- make the if statements use the dict.get check of _spec_property_naming
- remove the exception handling when importing module sin your test
- update your test to also check that the dog data was turned into a Dog instance
|
@spacether took care of the comments. here are the test results post changes, |
spacether
left a comment
There was a problem hiding this comment.
Thanks for making those updates. This looks good.
|
Ci error is csharp-netcore and is unrelated |

PR checklist
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.For Windows users, please run the script in Git BASH.
master,5.3.x,6.0.x#9409 added
_new_from_openapi_dataand updated the code to invoke this method at most places except one. This PR takes care of updating this as well.Deserialization of read-only attributes breaks without this change.
@spacether @wing328
Added a test that validates the fix.
Here is a snapshot of the same test failing when run on master branch codebase,


Here is a snapshot of the test passing when run against this PR branch,
