-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
[python] Fixes additional_properties_type for models #8802
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
Merged
spacether
merged 38 commits into
OpenAPITools:5.2.x
from
spacether:fixes_python_model_addprops_type
Mar 31, 2021
Merged
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
c8e889e
Fixes additionalProperties values for models, updates docs, adds tag …
spacether 474817e
Moves this.setDisallowAdditionalPropertiesIfNotPresent higher
spacether 3683e01
Makes setting additional_properties_model_instances contingent on the…
spacether 29f6c28
Fixes oneOf anyOf allOf instantiation logic
spacether ec6bc80
Removes Address from Cat definition
spacether 559d55d
Adds required vars for apple and banana, removes required vars from c…
spacether 51b6b9d
Updates composed schema vars to be set on self and all composed insta…
spacether 3eb34f4
Removes get_unused_args, get_var_name_to_model_instances, and get_add…
spacether 7455102
Fixes fruit + deserilization tests, creates ComposedSchemaWithPropsAn…
spacether 80b8b2e
Fixes FruitReq tests
spacether b7aad09
Fixes GmFruit tests
spacether cb5dd13
Fixes discard_unknown_keys tests
spacether 4d2edec
Samples updated
spacether 67a76b7
Removes additionalproperties False in Child
spacether 4274cbd
Samples updated
spacether 6afe5ac
Improves handling of v2 and v3 specs for isFreeFormObject, v2 sample …
spacether 442f18a
Adds cli option disallowAdditionalPropertiesIfNotPresent to python
spacether 3042098
Adds getAdditionalProperties method so the value for addProps will be…
spacether 3fce4cd
Reverts file
spacether 7653227
Reverts file
spacether d0e777e
Updates python doc
spacether 03c1d52
Reverted anytype_3 definition
spacether b73aacd
Updates test_deserialize_lizard
spacether a6de39f
Updates test_deserialize_dict_str_dog
spacether 2351992
Updates testDog
spacether 61d2a3e
Updates testChild
spacether db1474a
Adds v2 python_composition sample
spacether c291e1d
Adds needed files for python testing
spacether 44b93e6
Adds existing tests into the new python sample
spacether 9c25181
Fixes test_dog
spacether ee903ac
Removes addProps false form Dog
spacether 3f04eec
Fixes testChild
spacether 5939dc8
Updates how additionalProperties are set
spacether 0093925
Fixes empty_map type
spacether eb59107
Type generation fixed for v2 and v3 specs
spacether 320df49
Refactors getTypeString, updates artifactids in pom.xml files
spacether 0accfb9
Adds new python sample to CI testing I think
spacether 18cd0d8
Fixes artifactId collision, regenrates docs
spacether File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,10 @@ | ||
| # this file exists because in this file we omit setting disallowAdditionalPropertiesIfNotPresent | ||
| # which makes it default to false | ||
| # that false setting is needed for composed schemas to work | ||
| # Composed schemas are schemas that contain the allOf/oneOf/anyOf keywords. v2 specs only support the allOf keyword. | ||
| generatorName: python | ||
| outputDir: samples/client/petstore/python | ||
| inputSpec: modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml | ||
| templateDir: modules/openapi-generator/src/main/resources/python | ||
| additionalProperties: | ||
| disallowAdditionalPropertiesIfNotPresent: "true" | ||
| packageName: petstore_api |
7 changes: 7 additions & 0 deletions
7
bin/configs/python-oas2_disallowAdditionalPropertiesIfNotPresent.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| generatorName: python | ||
| outputDir: samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent | ||
| inputSpec: modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml | ||
| templateDir: modules/openapi-generator/src/main/resources/python | ||
| additionalProperties: | ||
| disallowAdditionalPropertiesIfNotPresent: "true" | ||
| packageName: petstore_api |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
requiredVars have been moved out of the init signature because the required vars were probably defined in the composed oneOf/anyOf/allOf schemas and this schema does not know about them. Please read why this was done in this PR's description.