* Add args to reserved words
* arg and args to _arg and _args in templates
* Corrections
* Test added
* Corrections
* Use arg and args as defined properties
* Removed unnecessary assertion
* Suggested change
* I feel the issue is due to the creation of self._var_name_to_model_instances while doing the deserialization of the data.
Earlier the Python SDK code was using get_var_name_to_model_instances function which was adding var name to model instances that contain it. So <class 'openapi_client.model.stream_options_all_of'> will not part of mapping in self._var_name_to_model_instances for variable name stream_options.
Now with the latest Python SDK code following is the way through which var_name_to_model_instances is created:
for prop_name in model_args:
if prop_name not in discarded_args:
var_name_to_model_instances[prop_name] = [self] + composed_instances
Now as we can see that the var_name_to_model_instances is populated with self and composed_instance which will also contain stream_options_all_of as a composed instance and there will be no check that if stream_options is present in composed_instances or not.
As there is no attribute_mapping found for stream_options in stream_options_all_of, the type for stream_options will be treated as dict for mapping stream_options_all_of as mentioned by @Chekov2k.
So what I suggest is the following code:
for prop_name in model_args:
if prop_name not in discarded_args:
var_name_to_model_instances[prop_name] = [self] + list(
filter(
lambda x: prop_name in x.openapi_types, composed_instances))
This way we can check if the property name is present in that composed instance or not. If it's okay for @spacether I can raise a PR for this.
* [get_item_all_of_bug]
Added samples, test cases to validate all_of schema.
* [getiem_all_of_bug]
Updated docs and samples.
* [getiem_all_of_bug]
Updated test cases, docs and samples.
* fix#11958 [BUG] python generates wrong model name and model file name
Modify AbstractPythonCodegen.toModelName just like AbstractJavaCodegen.toModelName
* add unit test
* update samples and docs
by
./bin/generate-samples.sh
./bin/utils/export_docs_generators.sh
* fix AbstractPythonCodegen#toModelName logic, remove underscore
* update samples and docs
by
./bin/generate-samples.sh
./bin/utils/export_docs_generators.sh
* adding a test for issues 10083
* commiting the generated files
* fix for the setattr issue
* commit generated files
Co-authored-by: Aanisha Mishra <aanisha.mishra05@gmail.com>
* Adds boolean enum component and object property and tests of it
* Regenerates samples
* Passes needed locale argument to toUpperCase
* Regenerates samples
* Don't include read-only properties in Python examples.
When using a schema with read-only fields as API inputs, Python
generates examples for those: this excludes them.
* Fix tests
* fix by mapping outside of class
* tests
* regeneration and tests
* server
* INDENT
* a
* enable mapping
* Revert "server"
This reverts commit 6fc9712fb550d258d0332df243ea5080565c6770.
* Samples regenerated
Co-authored-by: Justin Black <justin.a.black@gmail.com>
* Fixes additionalProperties values for models, updates docs, adds tag test of it, fixes frit and gmfruit tests
* Moves this.setDisallowAdditionalPropertiesIfNotPresent higher
* Makes setting additional_properties_model_instances contingent on the presence of addprosp in schema, updates sample spec composed schemas to remove addprops False form two
* Fixes oneOf anyOf allOf instantiation logic
* Removes Address from Cat definition
* Adds required vars for apple and banana, removes required vars from composed schema init sig
* Updates composed schema vars to be set on self and all composed instances
* Removes get_unused_args, get_var_name_to_model_instances, and get_additional_properties_model_instances
* Fixes fruit + deserilization tests, creates ComposedSchemaWithPropsAndNoAddProps
* Fixes FruitReq tests
* Fixes GmFruit tests
* Fixes discard_unknown_keys tests
* Samples updated
* Removes additionalproperties False in Child
* Samples updated
* Improves handling of v2 and v3 specs for isFreeFormObject, v2 sample spec updated with link to bug
* Adds cli option disallowAdditionalPropertiesIfNotPresent to python
* Adds getAdditionalProperties method so the value for addProps will be correct
* Reverts file
* Reverts file
* Updates python doc
* Reverted anytype_3 definition
* Updates test_deserialize_lizard
* Updates test_deserialize_dict_str_dog
* Updates testDog
* Updates testChild
* Adds v2 python_composition sample
* Adds needed files for python testing
* Adds existing tests into the new python sample
* Fixes test_dog
* Removes addProps false form Dog
* Fixes testChild
* Updates how additionalProperties are set
* Fixes empty_map type
* Type generation fixed for v2 and v3 specs
* Refactors getTypeString, updates artifactids in pom.xml files
* Adds new python sample to CI testing I think
* Fixes artifactId collision, regenrates docs
* Removes nulltype from python, updates samples
* Removes nulltype from the python requirements
* Removes nulltype import in models, moves requiredVars to optionalVars when approprieate
* python->python-legacy, python-experimental->python
* test with openjdk8
* test with openjdk11
* comment out rm
* move kotlin tests to circleci
* move kotlin tests
* move tests to circleci
* fix circleci
* rearrange test
* move tests
* use wrapper
Co-authored-by: Justin Black <justin.a.black@gmail.com>
* Adds v2 spec additionalproperties examples, adds v3 spec nulllable model example, updates samples
* Remaining samples updates
* Adds csharp generator update to handle models with multilevel parent types, which works for the AdditionalPropertiesObject model, samples updated
* Issue 1766 Modified mustache files for Go to support nullable in the spec v3.0+; Updated model files running .sh scripts for Go.
* Add "nullable" to fake yaml
* Add sample script for OAS3
* Fix output folder (openapi3)
* Run bin/openapi3/go-petstore.sh
* Update samples
* Update jaxrs-jersey
* Update python and php samples
* Add bin/openapi3/go-gin-petstore-server.sh
* Run bin/openapi3/go-gin-petstore-server.sh
* Update bin/openapi3/go-petstore-server.sh to generate "nullable" samples
* Run bin/openapi3/go-petstore-server.sh
* Fix duplicated `import`
* add multiple server support to python client
* various fixes
* minor fixes, add tests
* test oas2 python first
* fix tests
* fix issues reported by flake8
* update code format
* add python petstore to ensure up-to-date
* rearrange test
* fix E501
* fix tests
* add new files
* fix script permission
* fix index check
* update samples