OpenAPITools / OpenAPITools/openapi-generator
[BUG][JAVA][NATIVE] useEnumCaseInsensitive option not working for Enum Classes (Works for inner classes)
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Description
Changes made for default modelEnum template is missing in the native library. Therefore, fromValue method of enum classes always run as case sensitive even if useEnumCaseInsensitive option is enabled.
Default modelEnum.mustache:
https://github.com/OpenAPITools/openapi-generator/blob/746961d07a9048e4ea6ee09c4ea25100b4def065/modules/openapi-generator/src/main/resources/Java/modelEnum.mustache#L57-L67
Native Library's modelEnum.mustache:
https://github.com/OpenAPITools/openapi-generator/blob/746961d07a9048e4ea6ee09c4ea25100b4def065/modules/openapi-generator/src/main/resources/Java/libraries/native/modelEnum.mustache#L57-L67
openapi-generator version
7.6.0
OpenAPI declaration file content or url
Command line used for generation
Steps to reproduce
Related issues/PRs
Suggest a fix/enhancement
Copy the lines #L57-L67 in modules/openapi-generator/src/main/resources/Java/modelEnum.mustache to lines #L57-L67 in modules/openapi-generator/src/main/resources/Java/libraries/native/modelEnum.mustache
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Compare lines 57–67 of modules/openapi-generator/src/main/resources/Java/modelEnum.mustache with the corresponding section in modules/openapi-generator/src/main/resources/Java/libraries/native/modelEnum.mustache. Apply the same template change to the native library and verify that generated enum classes honor useEnumCaseInsensitive in fromValue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100