You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For required enums of length one, the python-experimental generator should be setting the default value to what the spec defines.
We were previously doing this but a PR update accidentally wiped out this feature.
* Updates ap.mustache for python-experimental, adds test test_test_endpoint_enums_length_one
* Removes sortParamsByRequiredFlag from python-experimental
* Removes duplicate params from docstring
Bug Report Checklist
Description
For required enums of length one, the python-experimental generator should be setting the default value to what the spec defines.
We were previously doing this but a PR update accidentally wiped out this feature.
Endpoint parameter example
Spec https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml#L1066
Generated code https://github.com/OpenAPITools/openapi-generator/blob/master/samples/client/petstore/python-experimental/petstore_api/api/fake_api.py#L1016
I am not seeing a test of this, it looks like we are not correctly loading these default values into the function definition
openapi-generator version
master branch
OpenAPI declaration file content or url
Command line used for generation
Steps to reproduce
Related issues/PRs
https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml#L1066
Suggest a fix
Please update the template here:
https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/python/python-experimental/api.mustache#L48
A dev user can:
The text was updated successfully, but these errors were encountered: