Given this OpenAPI specification for the sizeRange field of a Project model:
size:
type: string
description: Size range for this project
enum: [RANGE_0_10M,RANGE_10M_50M,RANGE_50M_100M]
example: RANGE_10M_50M
The jaxrs-spec OpenAPI generator results in a Project.class like:
public enum SizeEnum {
_0_10M(String.valueOf("RANGE_0_10M")), _10M_50M(String.valueOf("RANGE_10M_50M")), _50M_100M(String.valueOf("RANGE_50M_100M"));
The resulting enum values are shortened (for use in Java):
Project.SizeEnum._0_10M
I was prepared to ignore this inconvenience, but it's resulting in an exception in this case:
Enum.valueOf(Project.SizeEnum.class, "RANGE_0_10M");
No enum constant com.mycompany.my_project.Project.SizeEnum.RANGE_0_10M
Notes
If I add a value into the enum that begins with something other than RANGE_ this causes all of the enum values to appear correctly. I infer that some process is automagically shortening all of them because they share a prefix.
Is this an OpenAPI generator configuration I have access to? I can't find it: