* 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
* [req_vars_changes]
* Added new schema to generate samples to test the issue mentioned in the PR.
* Changed the variable name from setRequiredVars to initRequiredVars
* Added initRequiredVars as a generator additional property
* Regenerating the samples after rebasing the code with master branch
* Changed the description of additional property
* LDS-2166 : add request auth to api client and api call
Can now overwrite request auth by request
Envoyé depuis mon iPhone.
P.S. : Ce commit est certifié sans gluten
* LDS-2166 : Add samples
Envoyé depuis mon iPhone.
P.S. : Ce commit est certifié sans gluten
* LDS-2166 : fix test
Envoyé depuis mon iPhone.
P.S. : Ce commit est certifié sans gluten
* LDS-2166 : Fixing test in python_disallowAdditionalPropertiesIfNotPresent
Envoyé depuis mon iPhone.
P.S. : Ce commit est certifié sans gluten
* LDS-2166 : add removed line break
Envoyé depuis mon iPhone.
P.S. : Ce commit est certifié sans gluten
* LDS-2166 : add name for _request_auth params
Add None when _content_type is not set
Envoyé depuis mon iPhone.
P.S. : Ce commit est certifié sans gluten
* LDS-2166 : add tabulation
Envoyé depuis mon iPhone.
P.S. : Ce commit est certifié sans gluten
* LDS-2166 : fix missing values
Envoyé depuis mon iPhone.
P.S. : Ce commit est certifié sans gluten
* LDS-2166 : generate sample
Add _request_auth in sample
Envoyé depuis mon iPhone.
P.S. : Ce commit est certifié sans gluten
* Request auth can now use multiple auth
Request auth is now a list of dict
Envoyé depuis mon iPhone.
P.S. : Ce commit est certifié sans gluten
* Add request_auths in test
Envoyé depuis mon iPhone.
P.S. : Ce commit est certifié sans gluten
Co-authored-by: Géry THRASIBULE <g.thrasibule@lecomptoirdespharmacies.fr>
* Adds generatorLanguageVersion and uses it in python generators
* Regenerates docs
* Adds stability to generator docs
* Triple braces generatorLanguageVersion
* Regenerates samples
* Fixes the python-experimental setup.py file so it works with generatorLanguageVersion
* Updates generators readme
* add no_proxy support to python client
* add unittest for no_proxy supporting, python client
* update samples for no_proxy supporting, python client
* fix input parameter in samples/openapi3/.../tests_manual/test_extra_pool_config_options.py
* re-implement no_proxy support to python client according to PR conversation #10648
* re-update samples for no_proxy supporting, python client
* Adds get/setIsString interface to IJsonSchemaValidationProperties
* Adds get/set isNumber interface in IJsonSchemaValidationProperties
* Adds get/set isAnyType in IJsonSchemaValidationProperties
* Adds and uses ModelUtils.isAnyType, adds setTypeProperties
* Adds missing descriptions of isAnyType parameters
* Uses ModelUtils.isAnyType
* Samples regenerated
* Moves isArray handling higher up in fromProperty
* Moves isAnyTypeSchema handling higher up in fromProperty
* Moves isFreeFormObject handling higher up in fromProperty
* Refactors fromProperties, updates tests
* Fixes the fromProperty refactor, tests now pass
* Uses setTypeProperties to set isNumber, isNull, isArray, and isUnboundedInteger
* Sets isAnyType in setTypeProperties
* Sets isMap in setTypeProperties
* Sets property.isPrimitiveType in isFreeFormObject, tweaks if condition order
* Adds fix for JavaClientCodegenTest.testJdkHttpClientWithAndWithoutDiscriminator
* Refactors fromProperty
* Adds updatePropertyForObject updatePropertyForAnyType
* Sets binary and file types to not be strings
* Updates samples
* Adds updatePropertyForString
* Adds testComposedPropertyTypes
* Fixes python test
* Samples updated
* Switches all isAnyTypeSchema usages to ModelUtils.isAnyType
* Refactors model enum handling higher up
* Moves m.dataType assignent higher into fromModel
* Moves m.isNullable setting higher into isModel
* Adds updateModelForComposedSchema
* Further fromModel refactoring, all schema checks are now at the same indentation level
* Further refactors fromModel, adds isTypeObjectSchema block
* Moves addVars into anyType or objectType blocks in fromModel
* Turns off isNullable n isAnyType array
* Fixes typescript CodegenParameers
* Adds updatePropertyForAnyType to typescript-axios so property.isNullable will be false for AnyType
* Adds testComposedModelTypes
* Updates ComposedAnyType schema
* Fixes tests for JavaJAXRSCXF by adding updateModelForObject method
* Updates go and csharp to handle object model differently
* Adds updateModelForAnyType
* Fixes name reference
* Adds testComposedResponseTypes
* Refactoring fromResponse
* Further refactoring of fromResponse
* Uses setTypeProperties in fromResponse
* Tests now pass for testComposedResponseTypes
* Sets COdegenResponse dataType using getTypeDeclaration
* Begins refactoring of fromRequestBody
* Adds updateResponseBodyForPrimitiveType
* Adds all needed type if else blocks in fromRequestBody
* Fixes JavaJAXRSCXFExtServerCodegenTests
* Fixes RubyClientCodegenTests
* Adds fixes for clients that need custom isMap for body parameters
* Ruby broken, samples regened, debugging
* Adds updateRequestBodyForArray, renames updateRequest.. methods
* Samples regenerated
* Removes changes from Ruby generator
* Reverts RubyClientCodegen.java
* Reverts changes to GoClientCodegen.java
* Reverts PowerShellClientCodegen.java
* Reverts CrystalClientCodegen.java
* Removes updateRequestBodyForObject from JavaCXFServerCodegen.java
* Adds comment about refed models
* Tweaks made to fromProperties to add an explanatory comment
* Updates RustServer to have ByteArray request bodies not be strings
* Sets types in fromFormProperty
* Adds testComposedRequestBodyTypes
* Fixes when validation syncing is done in syncValidationProperties
* Removes redundant validation code from fromParameter
* Moves parameter inX setting higher up before schema logic in fromParameter
* More refactoring in fromParameter, uses early return to reduce levels of indentation
* Removes setParameterBooleanFlagWithCodegenProperty from updateRequestBodyForArray
* Removes setParameterBooleanFlagWithCodegenProperty from updateRequestBodyForObject
* Removes setParameterBooleanFlagWithCodegenProperty from updateRequestBodyForPrimitiveType
* Removes setParameterBooleanFlagWithCodegenProperty from updateRequestBodyForMap
* Removes setParameterBooleanFlagWithCodegenProperty from addBodyModelSchema
* Removes setParameterBooleanFlagWithCodegenProperty from fromFormProperty
* Refactors parameter array handling code into fromFormProperty
* Simplifies fromRequestBodyToFormParameters
* Removes setParameterBooleanFlagWithCodegenProperty from fromParameter
* Adds deprecated docstring to setParameterBooleanFlagWithCodegenProperty
* Refactors ModelUtils.isFileSchema out of string schema check
* Removes ModelUtils.isFileSchema from RustServer updateRequestBodyForString
* Improves comment text
* Fixes RustServer uuid type setting for CodegenParameter
* Removes unneeded parens
* Fixes array property examples
* Removes unused code
* Renames variable to itemsProperty
* Adds testComposedRequestQueryParamTypes
* Adds updatePropertyForAnyType to rustserver will not have changed model properties
* Hoists arrayInnerProperty._enum into parameter for html2 generator
* Moves turning string type off into the codegen files
* Adds two more missing locations in rustserver
* Moves addVarsRequiredVarsAdditionalProps into anytype and objecttype handling
* More refactoring of where addVarsRequiredVarsAdditionalProps is used
* Samples regenerated