Open kyhule opened 5 months ago
There are at least one more issue with enums on the kotlin generator that have hit us hard lately 😓 I have a fix for both, not sure if it's the proper fix or not since I suspect enums could in general be handled in the wrong way throughout the codebase atm, but I'll push up a PR to discuss the approach there.
Bug Report Checklist
Description
Enum parameters rely on
toString
for their values opposed to using thevalue
that is encapsulated in the enum object. This is especially problematic when setting theenumPropertyNaming
config to something other than the format of the enum values. Given the spec listed below and usingUPPERCASE
enum property naming, the resulting generated enum class and put function are:For example, for a call like
somePathPathEnumPut(PathEnumSomePathPathEnumPut.SOME_ENUM)
:Expected:
https://example.com/some/path/some_enum
Actual:
https://example.com/some/path/SOME_ENUM
openapi-generator version
Using gradle plugin versions 7.2.0, 7.3.0, and 7.4.0
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Just generate the code using the settings given above.
Related issues/PRs
Could not find one though
Suggest a fix
I am working around this issue by changing the generated code from the template here to use
paramName.value
instead.