I am using Swagger Codegen 3.0.19, also tried OpenAPI Generator 4.0.3.
Java Environment:
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
Runner:
java -jar ./libs/openapi-generator-cli-4.3.0.jar generate \
-i pet.yaml \
-g spring \
-o ./OUTPUT/api/
Here's my OpenAPI Schema:
openapi: "3.0.0"
....
CaptureStatus:
type: object
description: Holds current capture status.
properties:
status:
type: string
enum:
- ON
- OFF
description: Capture status values.
....
Output is:
....
public enum StatusEnum {
TRUE("true"),
FALSE("false");
private String value;
StatusEnum(String value) {
this.value = value;
}
....
Why does the codegen translate the ON/OFF enum to TRUE/FALSE? It does not do it when I generate using Swagger Editor GUI.