-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
[python-experimental] Support schema property which has $ref to 'oneOf' schema #6262
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
[python-experimental] Support schema property which has $ref to 'oneOf' schema #6262
Conversation
|
@spacether , I don't think we currently have any sample or unit test that exercises the following use case: a schema property is referencing a |
samples/openapi3/client/petstore/python-experimental/tests/test_deserialization.py
Outdated
Show resolved
Hide resolved
samples/openapi3/client/petstore/python-experimental/tests/test_deserialization.py
Outdated
Show resolved
Hide resolved
|
@sebastien-rosset please take a look at this branch which I made from this PR. My branch's update makes it so we can instantiate Drawings with oneOf class inputs for Shape and Triangle types. |
That's awesome, let me check. |
|
I have tested your proposed changes, this seems to work, which is great. |
samples/openapi3/client/petstore/python-experimental/test/test_drawing.py
Show resolved
Hide resolved
|
There is a dependency on #6121 being merged before we can handle the 'null' type in oneOf. If we have a |
spacether
left a comment
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.
Thanks for the PR. Looks good to me.
This PR adds support for use cases when a schema property is referencing another schema which is itself a oneOf.
PR checklist
./bin/(or Windows batch scripts under.\bin\windows) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run./bin/{LANG}-petstore.sh,./bin/openapi3/{LANG}-petstore.shif updating the code or mustache templates for a language ({LANG}) (e.g. php, ruby, python, etc).master,4.3.x,5.0.x. Default:master.