Fix: Keep acronyms uppercase in Java enum constants (#2850) by mohamedelhabib · Pull Request #2851 · glideapps/quicktype

Enum constants containing known acronyms (like "SPA") were being incorrectly converted when using --acronym-style=camel, e.g. "MULTI_SPA_IN_GROUP_REJECTED" became "MULTI_Spa_IN_GROUP_REJECTED".

For Java enum constants (UPPER_UNDERSCORE style), acronyms should always remain uppercase regardless of the --acronym-style setting.

  • Modified javaNameStyle() to use allUpperWordStyle for acronyms in enum constants
  • Added test case for enum with "SPA" acronym

Description

Related Issue

Motivation and Context

Previous Behaviour / Output

New Behaviour / Output

How Has This Been Tested?

Screenshots (if appropriate):