Open felixvd opened 2 years ago
I stumbled here because I have exactly the same problem, in my endpoints I only have a default response and I get
response_types_map = {}
I'm using python generator with openapi-generator-cli 7.5.0
Is there a workaround ?
Same here, using openapi-generator-cli 7.7.0 and the python generator (not python-legacy)
Bug Report Checklist
petstore_oas3_test.yaml
should produce the problemSummary: For endpoints that only specify a
default
response,python-legacy
clients always returnNone
.Description
If only the
default
response exists for an endpoint in the schema, that endpoint will pass an emptyresponse_types_map
tocall_api
:This is fatal, because it causes the response not to be serialized in
__call_api
ofapi_client.py
, so each call will returnNone
.Endpoints where the
responses
field contains the number codes'200'
work:openapi-generator version
5.4.0
OpenAPI declaration file content or url
https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/test/resources/3_0/petstore_oas3_test.yaml
Generation Details
openapi-generator-cli generate -i petstore_oas3_test.yaml -g python-legacy
has both non-working and working endpointsSteps to reproduce
Open
api/pet_api.py
with your favorite editor and search forresponse_types_map = {
to see the issue.Suggest a fix
I don't know yet, but the
python
generator does not have this problem, so the solution can surely be found in that template. If you know where to look I am thankful for pointers.