Created by: jsok
Given a spec like:
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
the generated code is unable to serialize it (reproduction in commit 834b4e3d):
test_model_to_dict (tests_manual.test_model_utils.ModelUtilsTests) ... ERROR
======================================================================
ERROR: test_model_to_dict (tests_manual.test_model_utils.ModelUtilsTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/jsok/dev/github.com/OpenAPITools/openapi-generator/samples/openapi3/client/petstore/python/tests_manual/test_model_utils.py", line 32, in test_model_to_dict
model_to_dict(model)
File "/Users/jsok/dev/github.com/OpenAPITools/openapi-generator/samples/openapi3/client/petstore/python/petstore_api/model_utils.py", line 1690, in model_to_dict
res.append(model_to_dict(v, serialize=serialize))
File "/Users/jsok/dev/github.com/OpenAPITools/openapi-generator/samples/openapi3/client/petstore/python/petstore_api/model_utils.py", line 1662, in model_to_dict
if model_instance._composed_schemas:
AttributeError: 'dict' object has no attribute '_composed_schemas'
----------------------------------------------------------------------
Ran 1 test in 0.001s
FAILED (errors=1)
Subsequent commit 83327324 contains the fix in model_to_dict
.
PR checklist
-
Read the contribution guidelines. -
Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community. -
Run the following to build the project and update samples: ./mvnw clean package ./bin/generate-samples.sh ./bin/utils/export_docs_generators.sh
./bin/generate-samples.sh bin/configs/java*
. For Windows users, please run the script in Git BASH. -
File the PR against the correct branch: master
(5.3.0),6.0.x
-
If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.
@spacether related to our earlier discussion: https://github.com/OpenAPITools/openapi-generator/pull/9153/files#r712601002 @arun-nalla @Jyhess @tomplus