-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
[BUG] PYTHON Generated Client unable to parse response including array: [SCHEMA_OBJECT] #10564
Comments
Hello, Did you make it work ? I'm running into the same problem. |
Experiencing the same thing. Please advise on the status of this bug. |
More support behind this issue, I'm also experiencing it |
Same here |
I believe this was fixed in 5.4 with #11234. |
@nmartins your spec has an issue
That is not allowed per https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#fixed-fields-19 Using Your updated sample is:
And running it one gets: Which makes sense because the payload:
Matches both of those schemas:
And
Note: json schema allows in additional (unknown) properties by default. If you want only your defined properties to be allowed in set additionalProperties to false in your object schema. |
Description
PYTHON generated client is crashing, unable to parse response containing an array[SCHEMA_OBJECT]
this is the stack trace:
Traceback (most recent call last):
File "/gen-cli-python/start-python-query-example.py", line 47, in
pprint(api_instance.group_query_external_id(external_id))
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/pprint.py", line 53, in pprint
printer.pprint(object)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/pprint.py", line 148, in pprint
self._format(object, self._stream, 0, 0, {}, 0)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/pprint.py", line 170, in _format
rep = self._repr(object, context, level)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/pprint.py", line 431, in _repr
repr, readable, recursive = self.format(object, context.copy(),
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/pprint.py", line 444, in format
return _safe_repr(object, context, maxlevels, level, self._sort_dicts)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/pprint.py", line 596, in _safe_repr
rep = repr(object)
File "/gen-cli-python/openapi_client/model_utils.py", line 176, in repr
return self.to_str()
File "/gen-cli-python/openapi_client/model_utils.py", line 517, in to_str
return pprint.pformat(self.to_dict())
File "/gen-cli-python/openapi_client/model_utils.py", line 513, in to_dict
return model_to_dict(self, serialize=False)
File "/gen-cli-python/openapi_client/model_utils.py", line 1662, in model_to_dict
res.append(model_to_dict(v, serialize=serialize))
File "/gen-cli-python/openapi_client/model_utils.py", line 1662, in model_to_dict
res.append(model_to_dict(v, serialize=serialize))
File "/gen-cli-python/openapi_client/model_utils.py", line 1634, in model_to_dict
if model_instance._composed_schemas:
AttributeError: 'dict' object has no attribute '_composed_schemas'
openapi-generator version
5.2.1
OpenAPI declaration file content or url
specs_and_example.zip
This is the Json Response example
It's failing to parse relatedUserArray into MtxRelatedUserObject
Generation Detail
java -jar openapi-generator-cli-5.2.1.jar generate -i openapi3.json --verbose -g python -o gen-cli-python
Steps to reproduce
The text was updated successfully, but these errors were encountered: