[Python] Added Support for Validating and Converting Model Attributes - #11134
Conversation
|
Forcing the generator to throw errors when trying to create undeclared attributes caused many errors in the existing tests. I'm still fairly new to python, so I'm not sure if this is a widely accepted practice or not, but if anyone has insight as to why this is done and/or what should be done about it in this project, please let me know! |
|
@spacether I noticed that a single test has failed. I don't believe this is related to the changes made in this PR, as the tests run when running |
|
@ckoegel more tests needed to be run. I just approved them. My intention is for users to not pass in spec named parameters into Model(args) like you are doing in this PR. Can you try what I suggested in your issue and respond there? |
|
As shown by comments in the ticket, spec property naming can be used by passing in the _spec_property_naming argument when instantiating models. We need that parameter to differentiate the two use cases where
@ckoegel How about I close this PR because our code already supports Validating and Converting Model Attributes with python naming and spec naming? |
|
PR has been updated to reflect the findings in #11133 |
spacether
left a comment
There was a problem hiding this comment.
Thank you for your PR. This looks great!
|
@ckoegel sorry for my delay on reviewing this PR. Could you regenerate the samples here? After that update is made I can merge it in. |
… into ckoegel-py-attributes
…openapi-generator into ckoegel-py-attributes
Solves #11133
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.0),6.0.x@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)