vojtechhabarta / typescript-generator

Generates TypeScript from Java - JSON declarations, REST service client
MIT License
1.14k stars 237 forks source link

How to map Java Enum with multiple fields #1063

Open oliverunger opened 3 months ago

oliverunger commented 3 months ago

@RequiredArgsConstructor @Getter public enum MyEnum {

ALPHA("a", "Alpha"),
BETA("b", "Beta"),
GAMMA("c", "Gamma"),

private final String id;
private final String displayName;

}

Tried @JsonFormat(shape = JsonFormat.Shape.OBJECT) and @JsonValue Annotations. Would expect at least a class with readonly instances for each enum entity.