OpenAPITools / OpenAPITools/openapi-generator
[REQ] Java: Use MACRO_CASE for generated enums
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
The Java generator tries to respect language idiom by uppercasing enum values, which is fantastic. However, when presented with an enum value that is already in PascalCase (such as CarrierAccount), it generates the simple uppercase CARRIERACCOUNT instead of the preferable CARRIER_ACCOUNT. It would be great to have the word separation reflected in the enum values.
This applies to both 3.3.4 and 4.0.0-beta3.
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
Start by locating the Java generator's enum-value naming logic and any existing tests for generated enums; the issue does not name specific files or tests. Use the PascalCase example CarrierAccount to trace the current output, then verify that generated values preserve word separation as CARRIER_ACCOUNT for the affected Java generator versions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100