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
[Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
Then using a $ref to refer to an enum (with a default value) the default value is not applied for the Python generators. The default value is applied if it is an inline enum.
openapi-generator version
7.6.0
OpenAPI declaration file content or url
components:
schemas:
TestEnum:
type: stringenum:
- ONE
- TWO
- THREE
- foUrTestEnumWithDefault:
type: stringenum:
- EIN
- ZWEI
- DREIdefault: ZWEITestModel:
type: objectrequired:
- test_enumproperties:
test_enum:
$ref: "#/components/schemas/TestEnum"test_string:
type: stringexample: "Just some string"test_enum_with_default:
$ref: "#/components/schemas/TestEnumWithDefault"test_string_with_default:
type: stringexample: "More string"default: "ahoy matey"test_inline_defined_enum_with_default:
type: stringenum:
- A
- B
- Cdefault: B
Generation Details
Steps to reproduce
Generate Python client or server and look at the generated test_model.py and test_enum_with_default.py
Bug Report Checklist
Description
Then using a
$ref
to refer to an enum (with a default value) the default value is not applied for the Python generators. The default value is applied if it is an inline enum.openapi-generator version
7.6.0
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Generate Python client or server and look at the generated test_model.py and test_enum_with_default.py
Related issues/PRs
#18796
Suggest a fix
Add better support for default values for Python with respect to enums
#18796
The text was updated successfully, but these errors were encountered: