OpenAPITools / OpenAPITools/openapi-generator

[REQ] Java: Use MACRO_CASE for generated enums

Open
#2,867 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.