-
Notifications
You must be signed in to change notification settings - Fork 437
Open
Labels
Description
With the following modification on petstore schema where I added minimum and maximum values, the generated POJO do not compile and give the following error:
"components": {
"schemas": {
"Order": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64",
"minimum": 0,
"maximum": 787878787878,
"example": 787878787878
}
Command used for code generation:
java -jar swagger-codegen-cli-3.0.72.jar generate -DperformBeanValidation=true -DuseBeanValidation=true -i ./petstore.json -l java -o api && mvn -f api/pom.xml clean package -Dmaven.compiler.source=21 -Dmaven.compiler.target=21
Build error:
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /test/api/src/main/java/io/swagger/client/api/StoreApi.java:[667,68] integer number too large
[ERROR] /test/api/src/main/java/io/swagger/client/model/Order.java:[109,15] integer number too large
[INFO] 2 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
A snippet from generated Order.java
102 /**
103 * Get id
104 * minimum: 0
105 * maximum: 787878787878
106 * @return id
107 **/
108 @NotNull
109 @Min(0) @Max(787878787878) @Schema(example = "9999999999", description = "")
110 public Long getId() {
111 return id;
112 }
As per my analysis the long literal "L" should be appended when extracting min/max from the parameterSchema: