Skip to content

Commit a769f26

Browse files
committed
Run scripts
1 parent 01b2998 commit a769f26

96 files changed

Lines changed: 287 additions & 284 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/generators/java-camel.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ These options may be applied as additional-properties (cli) or configOptions (pl
133133
|x-spring-paginated|Add `org.springframework.data.domain.Pageable` to controller method. Can be used to handle `page`, `size` and `sort` query parameters. If these query parameters are also specified in the operation spec, they will be removed from the controller method as their values can be obtained from the `Pageable` object.|OPERATION|false
134134
|x-version-param|Marker property that tells that this parameter would be used for endpoint versioning. Applicable for headers & query params. true/false|OPERATION_PARAMETER|null
135135
|x-pattern-message|Add this property whenever you need to customize the invalidation error message for the regex pattern of a variable|FIELD, OPERATION_PARAMETER|null
136+
|x-size-message|Add this property whenever you need to customize the invalidation error message for the size or length of a variable|FIELD, OPERATION_PARAMETER|null
137+
|x-minimum-message|Add this property whenever you need to customize the invalidation error message for the minimum value of a variable|FIELD, OPERATION_PARAMETER|null
138+
|x-maximum-message|Add this property whenever you need to customize the invalidation error message for the maximum value of a variable|FIELD, OPERATION_PARAMETER|null
136139
|x-spring-api-version|Value for 'version' attribute in @RequestMapping (for Spring 7 and above).|OPERATION|null
137140

138141

modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3758,22 +3758,22 @@ public void testModelsWithNoneOptionalAndJsonNullable() throws IOException {
37583758
.withType("JsonNullable<@Size(max = 1) String>")
37593759
.toType()
37603760
.assertProperty("intMinMaxNullable")
3761-
.withType("JsonNullable<@Min(1) @Max(10) Integer>")
3761+
.withType("JsonNullable<@Min(value = 1) @Max(value = 10) Integer>")
37623762
.toType()
37633763
.assertProperty("intMinNullable")
3764-
.withType("JsonNullable<@Min(1) Integer>")
3764+
.withType("JsonNullable<@Min(value = 1) Integer>")
37653765
.toType()
37663766
.assertProperty("intMaxNullable")
3767-
.withType("JsonNullable<@Max(10) Integer>")
3767+
.withType("JsonNullable<@Max(value = 10) Integer>")
37683768
.toType()
37693769
.assertProperty("numberMinMaxNullable")
3770-
.withType("JsonNullable<@DecimalMin(\"1\") @DecimalMax(\"10\") BigDecimal>")
3770+
.withType("JsonNullable<@DecimalMin(value = \"1\") @DecimalMax(value = \"10\") BigDecimal>")
37713771
.toType()
37723772
.assertProperty("numberMinNullable")
3773-
.withType("JsonNullable<@DecimalMin(\"1\") BigDecimal>")
3773+
.withType("JsonNullable<@DecimalMin(value = \"1\") BigDecimal>")
37743774
.toType()
37753775
.assertProperty("numberMaxNullable")
3776-
.withType("JsonNullable<@DecimalMax(\"10\") BigDecimal>")
3776+
.withType("JsonNullable<@DecimalMax(value = \"10\") BigDecimal>")
37773777
.toType()
37783778
.assertProperty("stringDefaultNullable")
37793779
.withType("JsonNullable<@Size(max = 1) String>")
@@ -3862,12 +3862,12 @@ public void testModelsWithNoneOptionalAndJsonNullable() throws IOException {
38623862
assertJsonNullableMethod(javaFileAssert, String.class, "stringMinLengthNullable", "JsonNullable<@Size(min = 1) String>");
38633863
assertJsonNullableMethod(javaFileAssert, String.class, "stringMaxLengthNullable", "JsonNullable<@Size(max = 1) String>");
38643864
assertJsonNullableMethod(javaFileAssert, String.class, "stringEmailNullable", "JsonNullable<@jakarta.validation.constraints.Email String>");
3865-
assertJsonNullableMethod(javaFileAssert, Integer.class, "intMinMaxNullable", "JsonNullable<@Min(1) @Max(10) Integer>");
3866-
assertJsonNullableMethod(javaFileAssert, Integer.class, "intMinNullable", "JsonNullable<@Min(1) Integer>");
3867-
assertJsonNullableMethod(javaFileAssert, Integer.class, "intMaxNullable", "JsonNullable<@Max(10) Integer>");
3868-
assertJsonNullableMethod(javaFileAssert, BigDecimal.class, "numberMinMaxNullable", "JsonNullable<@DecimalMin(\"1\") @DecimalMax(\"10\") BigDecimal>");
3869-
assertJsonNullableMethod(javaFileAssert, BigDecimal.class, "numberMinNullable", "JsonNullable<@DecimalMin(\"1\") BigDecimal>");
3870-
assertJsonNullableMethod(javaFileAssert, BigDecimal.class, "numberMaxNullable", "JsonNullable<@DecimalMax(\"10\") BigDecimal>");
3865+
assertJsonNullableMethod(javaFileAssert, Integer.class, "intMinMaxNullable", "JsonNullable<@Min(value = 1) @Max(value = 10) Integer>");
3866+
assertJsonNullableMethod(javaFileAssert, Integer.class, "intMinNullable", "JsonNullable<@Min(value = 1) Integer>");
3867+
assertJsonNullableMethod(javaFileAssert, Integer.class, "intMaxNullable", "JsonNullable<@Max(value = 10) Integer>");
3868+
assertJsonNullableMethod(javaFileAssert, BigDecimal.class, "numberMinMaxNullable", "JsonNullable<@DecimalMin(value = \"1\") @DecimalMax(value = \"10\") BigDecimal>");
3869+
assertJsonNullableMethod(javaFileAssert, BigDecimal.class, "numberMinNullable", "JsonNullable<@DecimalMin(value = \"1\") BigDecimal>");
3870+
assertJsonNullableMethod(javaFileAssert, BigDecimal.class, "numberMaxNullable", "JsonNullable<@DecimalMax(value = \"10\") BigDecimal>");
38713871

38723872
}
38733873

@@ -3936,22 +3936,22 @@ public void testModelsWithOptionalAndJsonNullable() throws IOException {
39363936
.withType("Optional<@jakarta.validation.constraints.Email String>")
39373937
.toType()
39383938
.assertProperty("intMinMax")
3939-
.withType("Optional<@Min(1) @Max(10) Integer>")
3939+
.withType("Optional<@Min(value = 1) @Max(value = 10) Integer>")
39403940
.toType()
39413941
.assertProperty("intMin")
3942-
.withType("Optional<@Min(1) Integer>")
3942+
.withType("Optional<@Min(value = 1) Integer>")
39433943
.toType()
39443944
.assertProperty("intMax")
3945-
.withType("Optional<@Max(10) Integer>")
3945+
.withType("Optional<@Max(value = 10) Integer>")
39463946
.toType()
39473947
.assertProperty("numberMinMax")
3948-
.withType("Optional<@DecimalMin(\"1\") @DecimalMax(\"10\") BigDecimal>")
3948+
.withType("Optional<@DecimalMin(value = \"1\") @DecimalMax(value = \"10\") BigDecimal>")
39493949
.toType()
39503950
.assertProperty("numberMin")
3951-
.withType("Optional<@DecimalMin(\"1\") BigDecimal>")
3951+
.withType("Optional<@DecimalMin(value = \"1\") BigDecimal>")
39523952
.toType()
39533953
.assertProperty("numberMax")
3954-
.withType("Optional<@DecimalMax(\"10\") BigDecimal>")
3954+
.withType("Optional<@DecimalMax(value = \"10\") BigDecimal>")
39553955
.toType()
39563956
.assertProperty("stringDefault")
39573957
.withType("Optional<@Size(max = 1) String>")
@@ -3974,22 +3974,22 @@ public void testModelsWithOptionalAndJsonNullable() throws IOException {
39743974
.withType("JsonNullable<@Size(max = 1) String>")
39753975
.toType()
39763976
.assertProperty("intMinMaxNullable")
3977-
.withType("JsonNullable<@Min(1) @Max(10) Integer>")
3977+
.withType("JsonNullable<@Min(value = 1) @Max(value = 10) Integer>")
39783978
.toType()
39793979
.assertProperty("intMinNullable")
3980-
.withType("JsonNullable<@Min(1) Integer>")
3980+
.withType("JsonNullable<@Min(value = 1) Integer>")
39813981
.toType()
39823982
.assertProperty("intMaxNullable")
3983-
.withType("JsonNullable<@Max(10) Integer>")
3983+
.withType("JsonNullable<@Max(value = 10) Integer>")
39843984
.toType()
39853985
.assertProperty("numberMinMaxNullable")
3986-
.withType("JsonNullable<@DecimalMin(\"1\") @DecimalMax(\"10\") BigDecimal>")
3986+
.withType("JsonNullable<@DecimalMin(value = \"1\") @DecimalMax(value = \"10\") BigDecimal>")
39873987
.toType()
39883988
.assertProperty("numberMinNullable")
3989-
.withType("JsonNullable<@DecimalMin(\"1\") BigDecimal>")
3989+
.withType("JsonNullable<@DecimalMin(value = \"1\") BigDecimal>")
39903990
.toType()
39913991
.assertProperty("numberMaxNullable")
3992-
.withType("JsonNullable<@DecimalMax(\"10\") BigDecimal>")
3992+
.withType("JsonNullable<@DecimalMax(value = \"10\") BigDecimal>")
39933993
.toType()
39943994
.assertProperty("stringDefaultNullable")
39953995
.withType("JsonNullable<@Size(max = 1) String>")
@@ -4065,25 +4065,25 @@ public void testModelsWithOptionalAndJsonNullable() throws IOException {
40654065
assertOptionalMethod(javaFileAssert, String.class, "stringMinLength", "Optional<@Size(min = 1) String>");
40664066
assertOptionalMethod(javaFileAssert, String.class, "stringMaxLength", "Optional<@Size(max = 1) String>");
40674067
assertOptionalMethod(javaFileAssert, String.class, "stringEmail", "Optional<@jakarta.validation.constraints.Email String>");
4068-
assertOptionalMethod(javaFileAssert, Integer.class, "intMinMax", "Optional<@Min(1) @Max(10) Integer>");
4069-
assertOptionalMethod(javaFileAssert, Integer.class, "intMin", "Optional<@Min(1) Integer>");
4070-
assertOptionalMethod(javaFileAssert, Integer.class, "intMax", "Optional<@Max(10) Integer>");
4071-
assertOptionalMethod(javaFileAssert, BigDecimal.class, "numberMinMax", "Optional<@DecimalMin(\"1\") @DecimalMax(\"10\") BigDecimal>");
4072-
assertOptionalMethod(javaFileAssert, BigDecimal.class, "numberMin", "Optional<@DecimalMin(\"1\") BigDecimal>");
4073-
assertOptionalMethod(javaFileAssert, BigDecimal.class, "numberMax", "Optional<@DecimalMax(\"10\") BigDecimal>");
4068+
assertOptionalMethod(javaFileAssert, Integer.class, "intMinMax", "Optional<@Min(value = 1) @Max(value = 10) Integer>");
4069+
assertOptionalMethod(javaFileAssert, Integer.class, "intMin", "Optional<@Min(value = 1) Integer>");
4070+
assertOptionalMethod(javaFileAssert, Integer.class, "intMax", "Optional<@Max(value = 10) Integer>");
4071+
assertOptionalMethod(javaFileAssert, BigDecimal.class, "numberMinMax", "Optional<@DecimalMin(value = \"1\") @DecimalMax(value = \"10\") BigDecimal>");
4072+
assertOptionalMethod(javaFileAssert, BigDecimal.class, "numberMin", "Optional<@DecimalMin(value = \"1\") BigDecimal>");
4073+
assertOptionalMethod(javaFileAssert, BigDecimal.class, "numberMax", "Optional<@DecimalMax(value = \"10\") BigDecimal>");
40744074
assertOptionalMethod(javaFileAssert, "Zebra", "zebra", "Optional<Zebra>");
40754075

40764076
assertJsonNullableMethod(javaFileAssert, String.class, "stringPatternNullable", "JsonNullable<@Pattern(regexp = \"[a-z]\") String>");
40774077
assertJsonNullableMethod(javaFileAssert, String.class, "stringMaxMinLengthNullable", "JsonNullable<@Size(min = 1, max = 10) String>");
40784078
assertJsonNullableMethod(javaFileAssert, String.class, "stringMinLengthNullable", "JsonNullable<@Size(min = 1) String>");
40794079
assertJsonNullableMethod(javaFileAssert, String.class, "stringMaxLengthNullable", "JsonNullable<@Size(max = 1) String>");
40804080
assertJsonNullableMethod(javaFileAssert, String.class, "stringEmailNullable", "JsonNullable<@jakarta.validation.constraints.Email String>");
4081-
assertJsonNullableMethod(javaFileAssert, Integer.class, "intMinMaxNullable", "JsonNullable<@Min(1) @Max(10) Integer>");
4082-
assertJsonNullableMethod(javaFileAssert, Integer.class, "intMinNullable", "JsonNullable<@Min(1) Integer>");
4083-
assertJsonNullableMethod(javaFileAssert, Integer.class, "intMaxNullable", "JsonNullable<@Max(10) Integer>");
4084-
assertJsonNullableMethod(javaFileAssert, BigDecimal.class, "numberMinMaxNullable", "JsonNullable<@DecimalMin(\"1\") @DecimalMax(\"10\") BigDecimal>");
4085-
assertJsonNullableMethod(javaFileAssert, BigDecimal.class, "numberMinNullable", "JsonNullable<@DecimalMin(\"1\") BigDecimal>");
4086-
assertJsonNullableMethod(javaFileAssert, BigDecimal.class, "numberMaxNullable", "JsonNullable<@DecimalMax(\"10\") BigDecimal>");
4081+
assertJsonNullableMethod(javaFileAssert, Integer.class, "intMinMaxNullable", "JsonNullable<@Min(value = 1) @Max(value = 10) Integer>");
4082+
assertJsonNullableMethod(javaFileAssert, Integer.class, "intMinNullable", "JsonNullable<@Min(value = 1) Integer>");
4083+
assertJsonNullableMethod(javaFileAssert, Integer.class, "intMaxNullable", "JsonNullable<@Max(value = 10) Integer>");
4084+
assertJsonNullableMethod(javaFileAssert, BigDecimal.class, "numberMinMaxNullable", "JsonNullable<@DecimalMin(value = \"1\") @DecimalMax(value = \"10\") BigDecimal>");
4085+
assertJsonNullableMethod(javaFileAssert, BigDecimal.class, "numberMinNullable", "JsonNullable<@DecimalMin(value = \"1\") BigDecimal>");
4086+
assertJsonNullableMethod(javaFileAssert, BigDecimal.class, "numberMaxNullable", "JsonNullable<@DecimalMax(value = \"10\") BigDecimal>");
40874087

40884088
}
40894089

modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ public void useBeanValidationGenerateAnnotationsForRequestBody() throws IOExcept
754754

755755
assertFileContains(
756756
Paths.get(files.get("AddApi.kt").getAbsolutePath()),
757-
"@Min(2)"
757+
"@Min(value=2)"
758758
);
759759
}
760760

samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/api/StoreApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ ResponseEntity<Map<String, Integer>> getInventory(
131131
)
132132

133133
ResponseEntity<Order> getOrderById(
134-
@NotNull @Min(1L) @Max(5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId
134+
@NotNull @Min(value = 1L) @Max(value = 5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId
135135
);
136136

137137

samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/StoreApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ ResponseEntity<Map<String, Integer>> getInventory(
118118
)
119119

120120
ResponseEntity<Order> getOrderById(
121-
@NotNull @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId
121+
@NotNull @Min(value = 1L) @Max(value = 5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId
122122
);
123123

124124

samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/StoreController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ ResponseEntity<Map<String, Integer>> getInventory(
118118
)
119119

120120
ResponseEntity<Order> getOrderById(
121-
@NotNull @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId
121+
@NotNull @Min(value = 1L) @Max(value = 5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId
122122
);
123123

124124

samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ ResponseEntity<Map<String, Integer>> getInventory(
118118
)
119119

120120
ResponseEntity<Order> getOrderById(
121-
@NotNull @Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId
121+
@NotNull @Min(value = 1L) @Max(value = 5L) @ApiParam(value = "ID of pet that needs to be fetched", required = true) @PathVariable("orderId") Long orderId
122122
);
123123

124124

samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/api/StoreApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ ResponseEntity<Map<String, Integer>> getInventory(
8080
)
8181

8282
ResponseEntity<Order> getOrderById(
83-
@NotNull @Min(1L) @Max(5L) @PathVariable("orderId") Long orderId
83+
@NotNull @Min(value = 1L) @Max(value = 5L) @PathVariable("orderId") Long orderId
8484
);
8585

8686

samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/StoreApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ ResponseEntity<Map<String, Integer>> getInventory(
131131
)
132132

133133
ResponseEntity<Order> getOrderById(
134-
@NotNull @Min(1L) @Max(5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId
134+
@NotNull @Min(value = 1L) @Max(value = 5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId
135135
);
136136

137137

samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ CompletableFuture<ResponseEntity<Map<String, Integer>>> getInventory(
132132
)
133133

134134
CompletableFuture<ResponseEntity<Order>> getOrderById(
135-
@NotNull @Min(1L) @Max(5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId
135+
@NotNull @Min(value = 1L) @Max(value = 5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId
136136
);
137137

138138

0 commit comments

Comments
 (0)