From 59bd0ebfbbc38fb49ea47e80db25d38ec5feb4fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1chym=20Metli=C4=8Dka?= Date: Mon, 9 Feb 2026 22:43:55 +0100 Subject: [PATCH 1/7] convert byte[] to String for operation params --- .../languages/AbstractJavaCodegen.java | 1 + .../codegen/languages/SpringCodegen.java | 21 +++++++++++++++++++ .../JavaSpring/cookieParams.mustache | 2 +- .../resources/JavaSpring/formParams.mustache | 2 +- .../JavaSpring/headerParams.mustache | 2 +- .../resources/JavaSpring/pathParams.mustache | 2 +- .../resources/JavaSpring/queryParams.mustache | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../org/openapitools/api/FakeApiDelegate.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../org/openapitools/api/FakeApiDelegate.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../org/openapitools/api/FakeApiDelegate.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../org/openapitools/api/FakeApiDelegate.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../org/openapitools/api/FakeApiDelegate.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../org/openapitools/api/FakeApiDelegate.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../org/openapitools/api/FakeApiDelegate.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../openapitools/virtualan/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- 38 files changed, 58 insertions(+), 36 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java index d1b89584670b..462b7619886d 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java @@ -290,6 +290,7 @@ public AbstractJavaCodegen() { typeMapping.put("date", "Date"); typeMapping.put("file", "File"); typeMapping.put("AnyType", "Object"); + typeMapping.put("ByteArray", "byte[]"); importMapping.put("BigDecimal", "java.math.BigDecimal"); importMapping.put("UUID", "java.util.UUID"); diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java index 2c3c584e931a..90160d2dc5eb 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java @@ -798,6 +798,7 @@ public void setIsVoid(boolean isVoid) { prepareVersioningParameters(ops); handleImplicitHeaders(operation); + convertByteArrayParamsToStringType(operation); } // The tag for the controller is the first tag of the first operation final CodegenOperation firstOperation = ops.get(0); @@ -813,6 +814,26 @@ public void setIsVoid(boolean isVoid) { return objs; } + /** + * Converts parameters of type {@code byte[]} (i.e., OpenAPI {@code type: string, format: byte}) to {@code String}. + *

+ * In OpenAPI, {@code type: string, format: byte} is a base64-encoded string. However, Spring does not automatically + * decode base64-encoded request parameters into {@code byte[]} for query, path, header, cookie, or form parameters. + * Therefore, these parameters are mapped to {@code String} to avoid incorrect type handling and to ensure the + * application receives the raw base64 string as provided by the client. + *

+ * + * @param operation the codegen operation whose parameters will be checked and converted if necessary + **/ + private void convertByteArrayParamsToStringType(CodegenOperation operation) { + var convertedParams = operation.allParams.stream() + .filter(CodegenParameter::getIsByteArray) + .filter(param -> param.isQueryParam || param.isPathParam || param.isHeaderParam || param.isCookieParam || param.isFormParam) + .peek(param -> param.dataType = "String") + .collect(Collectors.toList()); + LOGGER.info("Converted parameters {} from byte[] to String in operation {}", convertedParams.stream().map(param -> param.paramName), operation.operationId); + } + private interface DataTypeAssigner { void setReturnType(String returnType); diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/cookieParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/cookieParams.mustache index a255b5c7daf2..ef9ffa8efada 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/cookieParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/cookieParams.mustache @@ -1 +1 @@ -{{#isCookieParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{>paramDoc}} @CookieValue(name = "{{baseName}}"{{^required}}, required = false{{/required}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}){{>dateTimeParam}} {{>nullableAnnotation}}{{>optionalDataType}} {{paramName}}{{/isCookieParam}} \ No newline at end of file +{{#isCookieParam}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{>paramDoc}} @CookieValue(name = "{{baseName}}"{{^required}}, required = false{{/required}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}){{>dateTimeParam}} {{>nullableAnnotation}}{{>optionalDataType}} {{paramName}}{{#isByteArray}} /* base64 encoded binary */{{/isByteArray}}{{/isCookieParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/formParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/formParams.mustache index eaa958fc42c6..db050c7830cc 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/formParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{^isFile}}{{>paramDoc}}{{#useBeanValidation}} {{>beanValidationBodyParams}}@Valid{{/useBeanValidation}} {{#isModel}}@RequestPart{{/isModel}}{{^isModel}}{{#isArray}}@RequestPart{{/isArray}}{{^isArray}}{{#reactive}}@RequestPart{{/reactive}}{{^reactive}}@RequestParam{{/reactive}}{{/isArray}}{{/isModel}}(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}){{>dateTimeParam}} {{^required}}{{#useOptional}}Optional<{{/useOptional}}{{/required}}{{{dataType}}}{{^required}}{{#useOptional}}>{{/useOptional}}{{/required}} {{paramName}}{{/isFile}}{{#isFile}}{{>paramDoc}} @RequestPart(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{#reactive}}{{#isArray}}Flux<{{/isArray}}Part{{#isArray}}>{{/isArray}}{{/reactive}}{{^reactive}}{{#isArray}}List<{{/isArray}}MultipartFile{{#isArray}}>{{/isArray}}{{/reactive}} {{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{^isFile}}{{>paramDoc}}{{#useBeanValidation}} {{>beanValidationBodyParams}}@Valid{{/useBeanValidation}} {{#isModel}}@RequestPart{{/isModel}}{{^isModel}}{{#isArray}}@RequestPart{{/isArray}}{{^isArray}}{{#reactive}}@RequestPart{{/reactive}}{{^reactive}}@RequestParam{{/reactive}}{{/isArray}}{{/isModel}}(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}){{>dateTimeParam}} {{^required}}{{#useOptional}}Optional<{{/useOptional}}{{/required}}{{{dataType}}}{{^required}}{{#useOptional}}>{{/useOptional}}{{/required}} {{paramName}}{{/isFile}}{{#isByteArray}} /* base64 encoded binary */{{/isByteArray}}{{#isFile}}{{>paramDoc}} @RequestPart(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{#reactive}}{{#isArray}}Flux<{{/isArray}}Part{{#isArray}}>{{/isArray}}{{/reactive}}{{^reactive}}{{#isArray}}List<{{/isArray}}MultipartFile{{#isArray}}>{{/isArray}}{{/reactive}} {{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/headerParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/headerParams.mustache index 80b1d0a82341..7de918c2203f 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/headerParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/headerParams.mustache @@ -1 +1 @@ -{{#isHeaderParam}}{{#vendorExtensions.x-field-extra-annotation}}{{{.}}} {{/vendorExtensions.x-field-extra-annotation}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{>paramDoc}} @RequestHeader(value = "{{baseName}}", required = {{#required}}true{{/required}}{{^required}}false{{/required}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}){{>dateTimeParam}} {{>nullableAnnotation}}{{>optionalDataType}} {{paramName}}{{/isHeaderParam}} \ No newline at end of file +{{#isHeaderParam}}{{#vendorExtensions.x-field-extra-annotation}}{{{.}}} {{/vendorExtensions.x-field-extra-annotation}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{>paramDoc}} @RequestHeader(value = "{{baseName}}", required = {{#required}}true{{/required}}{{^required}}false{{/required}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}){{>dateTimeParam}} {{>nullableAnnotation}}{{>optionalDataType}} {{paramName}}{{#isByteArray}} /* base64 encoded binary */{{/isByteArray}}{{/isHeaderParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/pathParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/pathParams.mustache index 24ebb856a153..184ff7793f2f 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/pathParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/pathParams.mustache @@ -1 +1 @@ -{{#isPathParam}}{{#vendorExtensions.x-field-extra-annotation}}{{{.}}} {{/vendorExtensions.x-field-extra-annotation}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}{{>paramDoc}} @PathVariable("{{baseName}}"){{>dateTimeParam}}{{#isDeprecated}} @Deprecated{{/isDeprecated}} {{>optionalDataType}} {{paramName}}{{/isPathParam}} \ No newline at end of file +{{#isPathParam}}{{#vendorExtensions.x-field-extra-annotation}}{{{.}}} {{/vendorExtensions.x-field-extra-annotation}}{{#useBeanValidation}}{{>beanValidationPathParams}}{{/useBeanValidation}}{{>paramDoc}} @PathVariable("{{baseName}}"){{>dateTimeParam}}{{#isDeprecated}} @Deprecated{{/isDeprecated}} {{>optionalDataType}} {{paramName}}{{#isByteArray}} /* base64 encoded binary */{{/isByteArray}}{{/isPathParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/queryParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/queryParams.mustache index 56f7527eb92a..06ce33ffc58a 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/queryParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/queryParams.mustache @@ -1 +1 @@ -{{#isQueryParam}}{{#vendorExtensions.x-field-extra-annotation}}{{{.}}} {{/vendorExtensions.x-field-extra-annotation}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{>paramDoc}}{{#useBeanValidation}} @Valid{{/useBeanValidation}}{{^isModel}} @RequestParam(value = {{#isMap}}""{{/isMap}}{{^isMap}}"{{baseName}}"{{/isMap}}{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}){{/isModel}}{{>dateTimeParam}}{{#isDeprecated}} @Deprecated{{/isDeprecated}} {{>nullableAnnotation}}{{>optionalDataType}} {{paramName}}{{/isQueryParam}} \ No newline at end of file +{{#isQueryParam}}{{#vendorExtensions.x-field-extra-annotation}}{{{.}}} {{/vendorExtensions.x-field-extra-annotation}}{{#useBeanValidation}}{{>beanValidationQueryParams}}{{/useBeanValidation}}{{>paramDoc}}{{#useBeanValidation}} @Valid{{/useBeanValidation}}{{^isModel}} @RequestParam(value = {{#isMap}}""{{/isMap}}{{^isMap}}"{{baseName}}"{{/isMap}}{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}{{#defaultValue}}, defaultValue = "{{{.}}}"{{/defaultValue}}){{/isModel}}{{>dateTimeParam}}{{#isDeprecated}} @Deprecated{{/isDeprecated}} {{>nullableAnnotation}}{{>optionalDataType}} {{paramName}}{{#isByteArray}} /* base64 encoded binary */{{/isByteArray}}{{/isQueryParam}} \ No newline at end of file diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java index bea5db699e3f..3bf17985d294 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java @@ -216,7 +216,7 @@ void testEndpointParameters( @RequestParam(value = "number", required = true) BigDecimal number, @RequestParam(value = "double", required = true) Double _double, @RequestParam(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @RequestParam(value = "byte", required = true) byte[] _byte, + @RequestParam(value = "byte", required = true) String _byte /* base64 encoded binary */, @RequestParam(value = "integer", required = false) Integer integer, @RequestParam(value = "int32", required = false) Integer int32, @RequestParam(value = "int64", required = false) Long int64, diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java index 04a9124859d4..01dadd17b2f3 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java @@ -220,7 +220,7 @@ Mono testEndpointParameters( @RequestPart(value = "number", required = true) BigDecimal number, @RequestPart(value = "double", required = true) Double _double, @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @RequestPart(value = "byte", required = true) byte[] _byte, + @RequestPart(value = "byte", required = true) String _byte /* base64 encoded binary */, @RequestPart(value = "integer", required = false) Integer integer, @RequestPart(value = "int32", required = false) Integer int32, @RequestPart(value = "int64", required = false) Long int64, diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeApi.java index 0fefc031ea6d..64340c50a182 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeApi.java @@ -211,7 +211,7 @@ Mono> testEndpointParameters( @RequestPart(value = "number", required = true) BigDecimal number, @RequestPart(value = "double", required = true) Double _double, @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @RequestPart(value = "byte", required = true) byte[] _byte, + @RequestPart(value = "byte", required = true) String _byte /* base64 encoded binary */, @RequestPart(value = "integer", required = false) Integer integer, @RequestPart(value = "int32", required = false) Integer int32, @RequestPart(value = "int64", required = false) Long int64, diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeApi.java index fc8aa14fdf11..c5b0f02028f4 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeApi.java @@ -207,7 +207,7 @@ ResponseEntity testEndpointParameters( @RequestParam(value = "number", required = true) BigDecimal number, @RequestParam(value = "double", required = true) Double _double, @RequestParam(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @RequestParam(value = "byte", required = true) byte[] _byte, + @RequestParam(value = "byte", required = true) String _byte /* base64 encoded binary */, @RequestParam(value = "integer", required = false) Integer integer, @RequestParam(value = "int32", required = false) Integer int32, @RequestParam(value = "int64", required = false) Long int64, diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java index 2b5414dd0e62..2440174d36c8 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java @@ -315,7 +315,7 @@ ResponseEntity testEndpointParameters( @Parameter(name = "number", description = "None", required = true) @DecimalMin(value = "32.1") @DecimalMax(value = "543.2") @Valid @RequestParam(value = "number", required = true) BigDecimal number, @Parameter(name = "double", description = "None", required = true) @DecimalMin(value = "67.8") @DecimalMax(value = "123.4") @Valid @RequestParam(value = "double", required = true) Double _double, @Parameter(name = "pattern_without_delimiter", description = "None", required = true) @Pattern(regexp = "^[A-Z].*") @Valid @RequestParam(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @Parameter(name = "byte", description = "None", required = true) @Valid @RequestParam(value = "byte", required = true) byte[] _byte, + @Parameter(name = "byte", description = "None", required = true) @Valid @RequestParam(value = "byte", required = true) String _byte /* base64 encoded binary */, @Parameter(name = "integer", description = "None") @Min(value = 10) @Max(value = 100) @Valid @RequestParam(value = "integer", required = false) Integer integer, @Parameter(name = "int32", description = "None") @Min(value = 20) @Max(value = 200) @Valid @RequestParam(value = "int32", required = false) Integer int32, @Parameter(name = "int64", description = "None") @Valid @RequestParam(value = "int64", required = false) Long int64, diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java index 565ffd66dc3f..0a173336a649 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java @@ -364,7 +364,7 @@ default ResponseEntity testEndpointParameters( @Parameter(name = "number", description = "None", required = true) @DecimalMin(value = "32.1") @DecimalMax(value = "543.2") @Valid @RequestParam(value = "number", required = true) BigDecimal number, @Parameter(name = "double", description = "None", required = true) @DecimalMin(value = "67.8") @DecimalMax(value = "123.4") @Valid @RequestParam(value = "double", required = true) Double _double, @Parameter(name = "pattern_without_delimiter", description = "None", required = true) @Pattern(regexp = "^[A-Z].*") @Valid @RequestParam(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @Parameter(name = "byte", description = "None", required = true) @Valid @RequestParam(value = "byte", required = true) byte[] _byte, + @Parameter(name = "byte", description = "None", required = true) @Valid @RequestParam(value = "byte", required = true) String _byte /* base64 encoded binary */, @Parameter(name = "integer", description = "None") @Min(value = 10) @Max(value = 100) @Valid @RequestParam(value = "integer", required = false) Integer integer, @Parameter(name = "int32", description = "None") @Min(value = 20) @Max(value = 200) @Valid @RequestParam(value = "int32", required = false) Integer int32, @Parameter(name = "int64", description = "None") @Valid @RequestParam(value = "int64", required = false) Long int64, diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java index da19eea506c4..e9843810956f 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -207,7 +207,7 @@ default ResponseEntity testClientModel(Client client) { default ResponseEntity testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, - byte[] _byte, + String _byte, Integer integer, Integer int32, Long int64, diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java index af328fa7ff70..63ff33246137 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java @@ -404,7 +404,7 @@ default ResponseEntity testEndpointParameters( @Parameter(name = "number", description = "None", required = true) @DecimalMin(value = "32.1") @DecimalMax(value = "543.2") @Valid @RequestParam(value = "number", required = true) BigDecimal number, @Parameter(name = "double", description = "None", required = true) @DecimalMin(value = "67.8") @DecimalMax(value = "123.4") @Valid @RequestParam(value = "double", required = true) Double _double, @Parameter(name = "pattern_without_delimiter", description = "None", required = true) @Pattern(regexp = "^[A-Z].*") @Valid @RequestParam(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @Parameter(name = "byte", description = "None", required = true) @Valid @RequestParam(value = "byte", required = true) byte[] _byte, + @Parameter(name = "byte", description = "None", required = true) @Valid @RequestParam(value = "byte", required = true) String _byte /* base64 encoded binary */, @Parameter(name = "integer", description = "None") @Min(value = 10) @Max(value = 100) @Valid @RequestParam(value = "integer", required = false) Integer integer, @Parameter(name = "int32", description = "None") @Min(value = 20) @Max(value = 200) @Valid @RequestParam(value = "int32", required = false) Integer int32, @Parameter(name = "int64", description = "None") @Valid @RequestParam(value = "int64", required = false) Long int64, diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/api/FakeApi.java index 458409c67391..336c11e550aa 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/api/FakeApi.java @@ -343,7 +343,7 @@ ResponseEntity testEndpointParameters( @Parameter(name = "number", description = "None", required = true) @DecimalMin(value = "32.1") @DecimalMax(value = "543.2") @Valid @RequestParam(value = "number", required = true) BigDecimal number, @Parameter(name = "double", description = "None", required = true) @DecimalMin(value = "67.8") @DecimalMax(value = "123.4") @Valid @RequestParam(value = "double", required = true) Double _double, @Parameter(name = "pattern_without_delimiter", description = "None", required = true) @Pattern(regexp = "^[A-Z].*") @Valid @RequestParam(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @Parameter(name = "byte", description = "None", required = true) @Valid @RequestParam(value = "byte", required = true) byte[] _byte, + @Parameter(name = "byte", description = "None", required = true) @Valid @RequestParam(value = "byte", required = true) String _byte /* base64 encoded binary */, @Parameter(name = "integer", description = "None") @Min(value = 10) @Max(value = 100) @Valid @RequestParam(value = "integer", required = false) Integer integer, @Parameter(name = "int32", description = "None") @Min(value = 20) @Max(value = 200) @Valid @RequestParam(value = "int32", required = false) Integer int32, @Parameter(name = "int64", description = "None") @Valid @RequestParam(value = "int64", required = false) Long int64, diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java index 0ea604f8b3a9..e7ad9c81d6c0 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java @@ -396,7 +396,7 @@ default ResponseEntity testEndpointParameters( @ApiParam(value = "None", required = true) @DecimalMin(value = "32.1") @DecimalMax(value = "543.2") @Valid @RequestParam(value = "number", required = true) BigDecimal number, @ApiParam(value = "None", required = true) @DecimalMin(value = "67.8") @DecimalMax(value = "123.4") @Valid @RequestParam(value = "double", required = true) Double _double, @ApiParam(value = "None", required = true) @Pattern(regexp = "^[A-Z].*") @Valid @RequestParam(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "byte", required = true) byte[] _byte, + @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "byte", required = true) String _byte /* base64 encoded binary */, @ApiParam(value = "None") @Min(value = 10) @Max(value = 100) @Valid @RequestParam(value = "integer", required = false) Integer integer, @ApiParam(value = "None") @Min(value = 20) @Max(value = 200) @Valid @RequestParam(value = "int32", required = false) Integer int32, @ApiParam(value = "None") @Valid @RequestParam(value = "int64", required = false) Long int64, diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java index 0ea604f8b3a9..e7ad9c81d6c0 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java @@ -396,7 +396,7 @@ default ResponseEntity testEndpointParameters( @ApiParam(value = "None", required = true) @DecimalMin(value = "32.1") @DecimalMax(value = "543.2") @Valid @RequestParam(value = "number", required = true) BigDecimal number, @ApiParam(value = "None", required = true) @DecimalMin(value = "67.8") @DecimalMax(value = "123.4") @Valid @RequestParam(value = "double", required = true) Double _double, @ApiParam(value = "None", required = true) @Pattern(regexp = "^[A-Z].*") @Valid @RequestParam(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "byte", required = true) byte[] _byte, + @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "byte", required = true) String _byte /* base64 encoded binary */, @ApiParam(value = "None") @Min(value = 10) @Max(value = 100) @Valid @RequestParam(value = "integer", required = false) Integer integer, @ApiParam(value = "None") @Min(value = 20) @Max(value = 200) @Valid @RequestParam(value = "int32", required = false) Integer int32, @ApiParam(value = "None") @Valid @RequestParam(value = "int64", required = false) Long int64, diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/FakeApi.java index 6a98cfc50239..ff8f738c7dbd 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/FakeApi.java @@ -396,7 +396,7 @@ default ResponseEntity testEndpointParameters( @ApiParam(value = "None", required = true) @DecimalMin(value = "32.1") @DecimalMax(value = "543.2") @Valid @RequestParam(value = "number", required = true) BigDecimal number, @ApiParam(value = "None", required = true) @DecimalMin(value = "67.8") @DecimalMax(value = "123.4") @Valid @RequestParam(value = "double", required = true) Double _double, @ApiParam(value = "None", required = true) @Pattern(regexp = "^[A-Z].*") @Valid @RequestParam(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "byte", required = true) byte[] _byte, + @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "byte", required = true) String _byte /* base64 encoded binary */, @ApiParam(value = "None") @Min(value = 10) @Max(value = 100) @Valid @RequestParam(value = "integer", required = false) Integer integer, @ApiParam(value = "None") @Min(value = 20) @Max(value = 200) @Valid @RequestParam(value = "int32", required = false) Integer int32, @ApiParam(value = "None") @Valid @RequestParam(value = "int64", required = false) Long int64, diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java index f6fc153c2508..a2bc246f4aa6 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -356,7 +356,7 @@ default ResponseEntity testEndpointParameters( @ApiParam(value = "None", required = true) @DecimalMin(value = "32.1") @DecimalMax(value = "543.2") @Valid @RequestParam(value = "number", required = true) BigDecimal number, @ApiParam(value = "None", required = true) @DecimalMin(value = "67.8") @DecimalMax(value = "123.4") @Valid @RequestParam(value = "double", required = true) Double _double, @ApiParam(value = "None", required = true) @Pattern(regexp = "^[A-Z].*") @Valid @RequestParam(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "byte", required = true) byte[] _byte, + @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "byte", required = true) String _byte /* base64 encoded binary */, @ApiParam(value = "None") @Min(value = 10) @Max(value = 100) @Valid @RequestParam(value = "integer", required = false) Integer integer, @ApiParam(value = "None") @Min(value = 20) @Max(value = 200) @Valid @RequestParam(value = "int32", required = false) Integer int32, @ApiParam(value = "None") @Valid @RequestParam(value = "int64", required = false) Long int64, diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java index da19eea506c4..e9843810956f 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -207,7 +207,7 @@ default ResponseEntity testClientModel(Client client) { default ResponseEntity testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, - byte[] _byte, + String _byte, Integer integer, Integer int32, Long int64, diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java index f6fc153c2508..a2bc246f4aa6 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java @@ -356,7 +356,7 @@ default ResponseEntity testEndpointParameters( @ApiParam(value = "None", required = true) @DecimalMin(value = "32.1") @DecimalMax(value = "543.2") @Valid @RequestParam(value = "number", required = true) BigDecimal number, @ApiParam(value = "None", required = true) @DecimalMin(value = "67.8") @DecimalMax(value = "123.4") @Valid @RequestParam(value = "double", required = true) Double _double, @ApiParam(value = "None", required = true) @Pattern(regexp = "^[A-Z].*") @Valid @RequestParam(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "byte", required = true) byte[] _byte, + @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "byte", required = true) String _byte /* base64 encoded binary */, @ApiParam(value = "None") @Min(value = 10) @Max(value = 100) @Valid @RequestParam(value = "integer", required = false) Integer integer, @ApiParam(value = "None") @Min(value = 20) @Max(value = 200) @Valid @RequestParam(value = "int32", required = false) Integer int32, @ApiParam(value = "None") @Valid @RequestParam(value = "int64", required = false) Long int64, diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java index da19eea506c4..e9843810956f 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -207,7 +207,7 @@ default ResponseEntity testClientModel(Client client) { default ResponseEntity testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, - byte[] _byte, + String _byte, Integer integer, Integer int32, Long int64, diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java index c4ff183bddcf..145f5dba11c7 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java @@ -396,7 +396,7 @@ default ResponseEntity testEndpointParameters( @ApiParam(value = "None", required = true) @DecimalMin(value = "32.1") @DecimalMax(value = "543.2") @Valid @RequestParam(value = "number", required = true) BigDecimal number, @ApiParam(value = "None", required = true) @DecimalMin(value = "67.8") @DecimalMax(value = "123.4") @Valid @RequestParam(value = "double", required = true) Double _double, @ApiParam(value = "None", required = true) @Pattern(regexp = "^[A-Z].*") @Valid @RequestParam(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "byte", required = true) byte[] _byte, + @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "byte", required = true) String _byte /* base64 encoded binary */, @ApiParam(value = "None") @Min(value = 10) @Max(value = 100) @Valid @RequestParam(value = "integer", required = false) Integer integer, @ApiParam(value = "None") @Min(value = 20) @Max(value = 200) @Valid @RequestParam(value = "int32", required = false) Integer int32, @ApiParam(value = "None") @Valid @RequestParam(value = "int64", required = false) Long int64, diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java index e41dc080532a..3ae61fbceb5c 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java @@ -380,7 +380,7 @@ default Mono testEndpointParameters( @ApiParam(value = "None", required = true) @DecimalMin(value = "32.1") @DecimalMax(value = "543.2") @Valid @RequestPart(value = "number", required = true) BigDecimal number, @ApiParam(value = "None", required = true) @DecimalMin(value = "67.8") @DecimalMax(value = "123.4") @Valid @RequestPart(value = "double", required = true) Double _double, @ApiParam(value = "None", required = true) @Pattern(regexp = "^[A-Z].*") @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) String _byte /* base64 encoded binary */, @ApiParam(value = "None") @Min(value = 10) @Max(value = 100) @Valid @RequestPart(value = "integer", required = false) Integer integer, @ApiParam(value = "None") @Min(value = 20) @Max(value = 200) @Valid @RequestPart(value = "int32", required = false) Integer int32, @ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApiDelegate.java index 2037e56a08ad..84b558fba08f 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -232,7 +232,7 @@ default Mono testClientModel(Mono client, default Mono testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, - byte[] _byte, + String _byte, Integer integer, Integer int32, Long int64, diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java index 12fca957cad2..eb7cd4606012 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java @@ -370,7 +370,7 @@ default Mono> testEndpointParameters( @ApiParam(value = "None", required = true) @DecimalMin(value = "32.1") @DecimalMax(value = "543.2") @Valid @RequestPart(value = "number", required = true) BigDecimal number, @ApiParam(value = "None", required = true) @DecimalMin(value = "67.8") @DecimalMax(value = "123.4") @Valid @RequestPart(value = "double", required = true) Double _double, @ApiParam(value = "None", required = true) @Pattern(regexp = "^[A-Z].*") @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) byte[] _byte, + @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) String _byte /* base64 encoded binary */, @ApiParam(value = "None") @Min(value = 10) @Max(value = 100) @Valid @RequestPart(value = "integer", required = false) Integer integer, @ApiParam(value = "None") @Min(value = 20) @Max(value = 200) @Valid @RequestPart(value = "int32", required = false) Integer int32, @ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java index 4cd2a881a8a6..5a4f62ea18b9 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -233,7 +233,7 @@ default Mono> testClientModel(Mono client, default Mono> testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, - byte[] _byte, + String _byte, Integer integer, Integer int32, Long int64, diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java index fda642c0a4e4..d8c8baf81d36 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -321,7 +321,7 @@ default ResponseEntity testEndpointParameters( @ApiParam(value = "None", required = true) @DecimalMin(value = "32.1") @DecimalMax(value = "543.2") @Valid @RequestParam(value = "number", required = true) BigDecimal number, @ApiParam(value = "None", required = true) @DecimalMin(value = "67.8") @DecimalMax(value = "123.4") @Valid @RequestParam(value = "double", required = true) Double _double, @ApiParam(value = "None", required = true) @Pattern(regexp = "^[A-Z].*") @Valid @RequestParam(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "byte", required = true) byte[] _byte, + @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "byte", required = true) String _byte /* base64 encoded binary */, @ApiParam(value = "None") @Min(value = 10) @Max(value = 100) @Valid @RequestParam(value = "integer", required = false) Integer integer, @ApiParam(value = "None") @Min(value = 20) @Max(value = 200) @Valid @RequestParam(value = "int32", required = false) Integer int32, @ApiParam(value = "None") @Valid @RequestParam(value = "int64", required = false) Long int64, diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java index 9fe8275b290f..4258bf719ee9 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -184,7 +184,7 @@ default ResponseEntity testClientModel(Client body) { default ResponseEntity testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, - byte[] _byte, + String _byte, Integer integer, Integer int32, Long int64, diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java index fda642c0a4e4..d8c8baf81d36 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java @@ -321,7 +321,7 @@ default ResponseEntity testEndpointParameters( @ApiParam(value = "None", required = true) @DecimalMin(value = "32.1") @DecimalMax(value = "543.2") @Valid @RequestParam(value = "number", required = true) BigDecimal number, @ApiParam(value = "None", required = true) @DecimalMin(value = "67.8") @DecimalMax(value = "123.4") @Valid @RequestParam(value = "double", required = true) Double _double, @ApiParam(value = "None", required = true) @Pattern(regexp = "^[A-Z].*") @Valid @RequestParam(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "byte", required = true) byte[] _byte, + @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "byte", required = true) String _byte /* base64 encoded binary */, @ApiParam(value = "None") @Min(value = 10) @Max(value = 100) @Valid @RequestParam(value = "integer", required = false) Integer integer, @ApiParam(value = "None") @Min(value = 20) @Max(value = 200) @Valid @RequestParam(value = "int32", required = false) Integer int32, @ApiParam(value = "None") @Valid @RequestParam(value = "int64", required = false) Long int64, diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApiDelegate.java index 9fe8275b290f..4258bf719ee9 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -184,7 +184,7 @@ default ResponseEntity testClientModel(Client body) { default ResponseEntity testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, - byte[] _byte, + String _byte, Integer integer, Integer int32, Long int64, diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java index bcde37132895..3d40e76da48a 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -351,7 +351,7 @@ default ResponseEntity testEndpointParameters( @ApiParam(value = "None", required = true) @DecimalMin(value = "32.1") @DecimalMax(value = "543.2") @Valid @RequestParam(value = "number", required = true) BigDecimal number, @ApiParam(value = "None", required = true) @DecimalMin(value = "67.8") @DecimalMax(value = "123.4") @Valid @RequestParam(value = "double", required = true) Double _double, @ApiParam(value = "None", required = true) @Pattern(regexp = "^[A-Z].*") @Valid @RequestParam(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "byte", required = true) byte[] _byte, + @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "byte", required = true) String _byte /* base64 encoded binary */, @ApiParam(value = "None") @Min(value = 10) @Max(value = 100) @Valid @RequestParam(value = "integer", required = false) Integer integer, @ApiParam(value = "None") @Min(value = 20) @Max(value = 200) @Valid @RequestParam(value = "int32", required = false) Integer int32, @ApiParam(value = "None") @Valid @RequestParam(value = "int64", required = false) Long int64, diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java index bcde37132895..3d40e76da48a 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java @@ -351,7 +351,7 @@ default ResponseEntity testEndpointParameters( @ApiParam(value = "None", required = true) @DecimalMin(value = "32.1") @DecimalMax(value = "543.2") @Valid @RequestParam(value = "number", required = true) BigDecimal number, @ApiParam(value = "None", required = true) @DecimalMin(value = "67.8") @DecimalMax(value = "123.4") @Valid @RequestParam(value = "double", required = true) Double _double, @ApiParam(value = "None", required = true) @Pattern(regexp = "^[A-Z].*") @Valid @RequestParam(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "byte", required = true) byte[] _byte, + @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "byte", required = true) String _byte /* base64 encoded binary */, @ApiParam(value = "None") @Min(value = 10) @Max(value = 100) @Valid @RequestParam(value = "integer", required = false) Integer integer, @ApiParam(value = "None") @Min(value = 20) @Max(value = 200) @Valid @RequestParam(value = "int32", required = false) Integer int32, @ApiParam(value = "None") @Valid @RequestParam(value = "int64", required = false) Long int64, diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java index 4020a589b44a..a83dc616fcb8 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java @@ -396,7 +396,7 @@ default ResponseEntity testEndpointParameters( @ApiParam(value = "None", required = true) @DecimalMin(value = "32.1") @DecimalMax(value = "543.2") @Valid @RequestParam(value = "number", required = true) BigDecimal number, @ApiParam(value = "None", required = true) @DecimalMin(value = "67.8") @DecimalMax(value = "123.4") @Valid @RequestParam(value = "double", required = true) Double _double, @ApiParam(value = "None", required = true) @Pattern(regexp = "^[A-Z].*") @Valid @RequestParam(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "byte", required = true) byte[] _byte, + @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "byte", required = true) String _byte /* base64 encoded binary */, @ApiParam(value = "None") @Valid @RequestParam(value = "integer", required = false) Optional integer, @ApiParam(value = "None") @Valid @RequestParam(value = "int32", required = false) Optional int32, @ApiParam(value = "None") @Valid @RequestParam(value = "int64", required = false) Optional int64, diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java index e97f35fedc01..230b6e57346f 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java @@ -417,7 +417,7 @@ default ResponseEntity testEndpointParameters( @Parameter(name = "number", description = "None", required = true) @DecimalMin(value = "32.1") @DecimalMax(value = "543.2") @Valid @RequestParam(value = "number", required = true) BigDecimal number, @Parameter(name = "double", description = "None", required = true) @DecimalMin(value = "67.8") @DecimalMax(value = "123.4") @Valid @RequestParam(value = "double", required = true) Double _double, @Parameter(name = "pattern_without_delimiter", description = "None", required = true) @Pattern(regexp = "^[A-Z].*") @Valid @RequestParam(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @Parameter(name = "byte", description = "None", required = true) @Valid @RequestParam(value = "byte", required = true) byte[] _byte, + @Parameter(name = "byte", description = "None", required = true) @Valid @RequestParam(value = "byte", required = true) String _byte /* base64 encoded binary */, @Parameter(name = "integer", description = "None") @Min(value = 10) @Max(value = 100) @Valid @RequestParam(value = "integer", required = false) Integer integer, @Parameter(name = "int32", description = "None") @Min(value = 20) @Max(value = 200) @Valid @RequestParam(value = "int32", required = false) Integer int32, @Parameter(name = "int64", description = "None") @Valid @RequestParam(value = "int64", required = false) Long int64, diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeApi.java index f7d277c5047b..ae1e007efe15 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeApi.java @@ -545,7 +545,7 @@ default ResponseEntity testEndpointParameters( @ApiParam(value = "None", required = true) @DecimalMin(value = "32.1") @DecimalMax(value = "543.2") @Valid @RequestParam(value = "number", required = true) BigDecimal number, @ApiParam(value = "None", required = true) @DecimalMin(value = "67.8") @DecimalMax(value = "123.4") @Valid @RequestParam(value = "double", required = true) Double _double, @ApiParam(value = "None", required = true) @Pattern(regexp = "^[A-Z].*") @Valid @RequestParam(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "byte", required = true) byte[] _byte, + @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "byte", required = true) String _byte /* base64 encoded binary */, @ApiParam(value = "None") @Min(value = 10) @Max(value = 100) @Valid @RequestParam(value = "integer", required = false) Integer integer, @ApiParam(value = "None") @Min(value = 20) @Max(value = 200) @Valid @RequestParam(value = "int32", required = false) Integer int32, @ApiParam(value = "None") @Valid @RequestParam(value = "int64", required = false) Long int64, diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java index 6baadd22ffc9..b6e35bd7ee45 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java @@ -396,7 +396,7 @@ default ResponseEntity testEndpointParameters( @ApiParam(value = "None", required = true) @DecimalMin(value = "32.1") @DecimalMax(value = "543.2") @Valid @RequestParam(value = "number", required = true) BigDecimal number, @ApiParam(value = "None", required = true) @DecimalMin(value = "67.8") @DecimalMax(value = "123.4") @Valid @RequestParam(value = "double", required = true) Double _double, @ApiParam(value = "None", required = true) @Pattern(regexp = "^[A-Z].*") @Valid @RequestParam(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "byte", required = true) byte[] _byte, + @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "byte", required = true) String _byte /* base64 encoded binary */, @ApiParam(value = "None") @Min(value = 10) @Max(value = 100) @Valid @RequestParam(value = "integer", required = false) Integer integer, @ApiParam(value = "None") @Min(value = 20) @Max(value = 200) @Valid @RequestParam(value = "int32", required = false) Integer int32, @ApiParam(value = "None") @Valid @RequestParam(value = "int64", required = false) Long int64, From 78499b6e4c4955eb496ebf3b324bc9ccfd4daafd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1chym=20Metli=C4=8Dka?= Date: Mon, 9 Feb 2026 23:43:04 +0100 Subject: [PATCH 2/7] add unit tests --- .../java/assertions/PropertyAssert.java | 14 ++ .../java/spring/SpringCodegenTest.java | 86 +++++++++ .../3_0/spring/byte-format-edge-cases.yaml | 171 ++++++++++++++++++ 3 files changed, 271 insertions(+) create mode 100644 modules/openapi-generator/src/test/resources/3_0/spring/byte-format-edge-cases.yaml diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/PropertyAssert.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/PropertyAssert.java index e598c210a1f6..401d87fddfca 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/PropertyAssert.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/assertions/PropertyAssert.java @@ -26,6 +26,20 @@ public PropertyAssert withType(final String expectedType) { return this; } + public PropertyAssert isArray() { + Assertions.assertThat(actual.getCommonType().isArrayType()) + .withFailMessage("Expected property %s to be array, but it was NOT", actual.getVariable(0).getNameAsString()) + .isEqualTo(true); + return this; + } + + public PropertyAssert isNotArray() { + Assertions.assertThat(actual.getCommonType().isArrayType()) + .withFailMessage("Expected property %s NOT to be array, but it was", actual.getVariable(0).getNameAsString()) + .isEqualTo(false); + return this; + } + public PropertyAnnotationsAssert assertPropertyAnnotations() { return new PropertyAnnotationsAssert(this, actual.getAnnotations()); } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java index ac819033d71e..66894b8e9c44 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java @@ -864,6 +864,92 @@ public void testSchemaImplements() throws IOException { .implementsInterfaces(fooInterface, fooAnotherInterface); } + + @Test + public void shouldHandleFormatByteCorrectlyForAllApiParametersAndProperties() throws IOException { + final SpringCodegen codegen = new SpringCodegen(); + + final Map files = generateFiles(codegen, "src/test/resources/3_0/spring/byte-format-edge-cases.yaml"); + // Query parameters: both plain text and Base64-encoded fields are mapped to String + JavaFileAssert.assertThat(files.get("QueryApi.java")) + .assertMethod("queryParams") + .assertParameter("plain") + .hasType("String"); // plain query param → always String + JavaFileAssert.assertThat(files.get("QueryApi.java")) + .assertMethod("queryParams") + .assertParameter("_byte") + .hasType("String"); // Base64 query param → String (manual decoding needed) + + // Path parameters: same behavior as query params + JavaFileAssert.assertThat(files.get("PathApi.java")) + .assertMethod("pathParams") + .assertParameter("plain") + .hasType("String"); // path param → String + JavaFileAssert.assertThat(files.get("PathApi.java")) + .assertMethod("pathParams") + .assertParameter("_byte") + .hasType("String"); // Base64 path param → String + + // Header parameters: always String + JavaFileAssert.assertThat(files.get("HeaderApi.java")) + .assertMethod("headerParams") + .assertParameter("xPlain") + .hasType("String"); // header → String + JavaFileAssert.assertThat(files.get("HeaderApi.java")) + .assertMethod("headerParams") + .assertParameter("xByte") + .hasType("String"); // Base64 header → String + + // Cookie parameters: always String + JavaFileAssert.assertThat(files.get("CookieApi.java")) + .assertMethod("cookieParams") + .assertParameter("plain") + .hasType("String"); // cookie → String + JavaFileAssert.assertThat(files.get("CookieApi.java")) + .assertMethod("cookieParams") + .assertParameter("_byte") + .hasType("String"); // Base64 cookie → String + + // Form fields: text fields → String + JavaFileAssert.assertThat(files.get("FormApi.java")) + .assertMethod("formParams") + .assertParameter("plain") + .hasType("String"); // form field → String + JavaFileAssert.assertThat(files.get("FormApi.java")) + .assertMethod("formParams") + .assertParameter("_byte") + .hasType("String"); // Base64 form field → String + + // Multipart fields: text fields → String, files → MultipartFile + JavaFileAssert.assertThat(files.get("MultipartApi.java")) + .assertMethod("multipartParams") + .assertParameter("plain") + .hasType("String"); // multipart text field → String + JavaFileAssert.assertThat(files.get("MultipartApi.java")) + .assertMethod("multipartParams") + .assertParameter("_byte") + .hasType("String"); // Base64 multipart text → String + JavaFileAssert.assertThat(files.get("MultipartApi.java")) + .assertMethod("multipartParams") + .assertParameter("file") + .hasType("MultipartFile"); // binary file upload → MultipartFile + + // Form request DTO: JSON or form object mapping + JavaFileAssert.assertThat(files.get("FormParamsRequest.java")) + .assertProperty("plain") + .withType("String"); // text property → String + JavaFileAssert.assertThat(files.get("FormParamsRequest.java")) + .assertProperty("_byte") + .isArray() + .withType("byte"); // Base64 property in DTO → auto-decoded to byte[] + + // Binary request body: bound as Resource for streaming + JavaFileAssert.assertThat(files.get("BinaryBodyApi.java")) + .assertMethod("binaryBody") + .assertParameter("body") + .hasType("org.springframework.core.io.Resource"); // raw binary body → Resource (streamable) + } + @Test public void shouldAddParameterWithInHeaderWhenImplicitHeadersIsTrue_issue14418() throws IOException { File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); diff --git a/modules/openapi-generator/src/test/resources/3_0/spring/byte-format-edge-cases.yaml b/modules/openapi-generator/src/test/resources/3_0/spring/byte-format-edge-cases.yaml new file mode 100644 index 000000000000..bf6971217ff7 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/spring/byte-format-edge-cases.yaml @@ -0,0 +1,171 @@ +openapi: 3.0.3 +info: + title: Byte Format Edge Cases + version: 1.0.0 + +paths: + /queryfdsfsd: + get: + operationId: queryParamsfdsfsfdsfs + summary: Query parametersfsdaf + parameters: + - name: plain + in: query + schema: + type: string + + responses: + '204': + description: No content + + /query: + get: + operationId: queryParams + summary: Query parameters + parameters: + - name: plain + in: query + schema: + type: string + - name: byte + in: query + schema: + type: string + format: byte + responses: + '204': + description: No content + + /path/{plain}/{byte}: + get: + operationId: pathParams + summary: Path parameters + parameters: + - name: plain + in: path + required: true + schema: + type: string + - name: byte + in: path + required: true + schema: + type: string + format: byte + responses: + '204': + description: No content + + /header: + get: + operationId: headerParams + summary: Header parameters + parameters: + - name: X-Plain + in: header + schema: + type: string + - name: X-Byte + in: header + schema: + type: string + format: byte + responses: + '204': + description: No content + + /cookie: + get: + operationId: cookieParams + summary: Cookie parameters + parameters: + - name: plain + in: cookie + schema: + type: string + - name: byte + in: cookie + schema: + type: string + format: byte + responses: + '204': + description: No content + + /form: + post: + operationId: formParams + summary: application/x-www-form-urlencoded + requestBody: + required: true + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + plain: + type: string + byte: + type: string + format: byte + responses: + '204': + description: No content + + /multipart: + post: + operationId: multipartParams + summary: multipart/form-data + requestBody: + required: true + content: + multipart/form-data: + schema: + type: object + properties: + plain: + type: string + byte: + type: string + format: byte + file: + type: string + format: binary + responses: + '204': + description: No content + + /json-body: + post: + operationId: jsonBody + summary: JSON request body + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + plain: + type: string + byte: + type: string + format: byte + responses: + '204': + description: No content + + /binary-body: + post: + operationId: binaryBody + summary: Raw binary body + requestBody: + required: true + content: + application/octet-stream: + schema: + type: string + format: binary + responses: + '204': + description: No content From 02a530a15a9acedf6cd2bbf8f8ed5b5f55535466 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1chym=20Metli=C4=8Dka?= Date: Mon, 9 Feb 2026 23:56:32 +0100 Subject: [PATCH 3/7] clean up open api spec --- .../3_0/spring/byte-format-edge-cases.yaml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/modules/openapi-generator/src/test/resources/3_0/spring/byte-format-edge-cases.yaml b/modules/openapi-generator/src/test/resources/3_0/spring/byte-format-edge-cases.yaml index bf6971217ff7..437458591083 100644 --- a/modules/openapi-generator/src/test/resources/3_0/spring/byte-format-edge-cases.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/spring/byte-format-edge-cases.yaml @@ -4,20 +4,6 @@ info: version: 1.0.0 paths: - /queryfdsfsd: - get: - operationId: queryParamsfdsfsfdsfs - summary: Query parametersfsdaf - parameters: - - name: plain - in: query - schema: - type: string - - responses: - '204': - description: No content - /query: get: operationId: queryParams From 8685cb99ab9f586c666a3a9072fe52cc4bd0eca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1chym=20Metli=C4=8Dka?= Date: Tue, 10 Feb 2026 09:07:29 +0100 Subject: [PATCH 4/7] fix CR suggestions --- .../resources/JavaSpring/formParams.mustache | 2 +- .../java/spring/SpringCodegenTest.java | 27 ++- .../spring/KotlinSpringServerCodegenTest.java | 22 +++ .../3_0/kotlin/byte-format-edge-cases.yaml | 157 ++++++++++++++++++ .../3_0/spring/byte-format-edge-cases.yaml | 14 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 34 ++-- .../java/org/openapitools/api/PetApi.java | 8 +- .../java/org/openapitools/api/FakeApi.java | 34 ++-- .../java/org/openapitools/api/PetApi.java | 8 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 36 ++-- .../java/org/openapitools/api/PetApi.java | 6 +- .../java/org/openapitools/api/FakeApi.java | 36 ++-- .../java/org/openapitools/api/PetApi.java | 6 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../openapitools/virtualan/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 2 +- 33 files changed, 310 insertions(+), 120 deletions(-) create mode 100644 modules/openapi-generator/src/test/resources/3_0/kotlin/byte-format-edge-cases.yaml diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/formParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/formParams.mustache index db050c7830cc..025005f11c3b 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/formParams.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/formParams.mustache @@ -1 +1 @@ -{{#isFormParam}}{{^isFile}}{{>paramDoc}}{{#useBeanValidation}} {{>beanValidationBodyParams}}@Valid{{/useBeanValidation}} {{#isModel}}@RequestPart{{/isModel}}{{^isModel}}{{#isArray}}@RequestPart{{/isArray}}{{^isArray}}{{#reactive}}@RequestPart{{/reactive}}{{^reactive}}@RequestParam{{/reactive}}{{/isArray}}{{/isModel}}(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}){{>dateTimeParam}} {{^required}}{{#useOptional}}Optional<{{/useOptional}}{{/required}}{{{dataType}}}{{^required}}{{#useOptional}}>{{/useOptional}}{{/required}} {{paramName}}{{/isFile}}{{#isByteArray}} /* base64 encoded binary */{{/isByteArray}}{{#isFile}}{{>paramDoc}} @RequestPart(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{#reactive}}{{#isArray}}Flux<{{/isArray}}Part{{#isArray}}>{{/isArray}}{{/reactive}}{{^reactive}}{{#isArray}}List<{{/isArray}}MultipartFile{{#isArray}}>{{/isArray}}{{/reactive}} {{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{^isFile}}{{>paramDoc}}{{#useBeanValidation}} {{>beanValidationBodyParams}}@Valid{{/useBeanValidation}} {{#isModel}}@RequestParam{{/isModel}}{{^isModel}}{{#isArray}}@RequestParam{{/isArray}}{{^isArray}}{{#reactive}}@RequestParam{{/reactive}}{{^reactive}}@RequestParam{{/reactive}}{{/isArray}}{{/isModel}}(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}){{>dateTimeParam}} {{^required}}{{#useOptional}}Optional<{{/useOptional}}{{/required}}{{{dataType}}}{{^required}}{{#useOptional}}>{{/useOptional}}{{/required}} {{paramName}}{{/isFile}}{{#isByteArray}} /* base64 encoded binary */{{/isByteArray}}{{#isFile}}{{>paramDoc}} @RequestPart(value = "{{baseName}}"{{#required}}, required = true{{/required}}{{^required}}, required = false{{/required}}) {{#reactive}}{{#isArray}}Flux<{{/isArray}}Part{{#isArray}}>{{/isArray}}{{/reactive}}{{^reactive}}{{#isArray}}List<{{/isArray}}MultipartFile{{#isArray}}>{{/isArray}}{{/reactive}} {{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java index 66894b8e9c44..1f216196cf64 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java @@ -877,7 +877,7 @@ public void shouldHandleFormatByteCorrectlyForAllApiParametersAndProperties() th .hasType("String"); // plain query param → always String JavaFileAssert.assertThat(files.get("QueryApi.java")) .assertMethod("queryParams") - .assertParameter("_byte") + .assertParameter("bytes") .hasType("String"); // Base64 query param → String (manual decoding needed) // Path parameters: same behavior as query params @@ -887,7 +887,7 @@ public void shouldHandleFormatByteCorrectlyForAllApiParametersAndProperties() th .hasType("String"); // path param → String JavaFileAssert.assertThat(files.get("PathApi.java")) .assertMethod("pathParams") - .assertParameter("_byte") + .assertParameter("bytes") .hasType("String"); // Base64 path param → String // Header parameters: always String @@ -907,7 +907,7 @@ public void shouldHandleFormatByteCorrectlyForAllApiParametersAndProperties() th .hasType("String"); // cookie → String JavaFileAssert.assertThat(files.get("CookieApi.java")) .assertMethod("cookieParams") - .assertParameter("_byte") + .assertParameter("bytes") .hasType("String"); // Base64 cookie → String // Form fields: text fields → String @@ -917,29 +917,40 @@ public void shouldHandleFormatByteCorrectlyForAllApiParametersAndProperties() th .hasType("String"); // form field → String JavaFileAssert.assertThat(files.get("FormApi.java")) .assertMethod("formParams") - .assertParameter("_byte") + .assertParameter("bytes") .hasType("String"); // Base64 form field → String // Multipart fields: text fields → String, files → MultipartFile + // Verifies that a simple multipart text field is generated as a String parameter JavaFileAssert.assertThat(files.get("MultipartApi.java")) .assertMethod("multipartParams") .assertParameter("plain") .hasType("String"); // multipart text field → String + + // Verifies that a Base64-encoded multipart field is treated as text (String) + // and is bound using @RequestParam rather than @RequestPart JavaFileAssert.assertThat(files.get("MultipartApi.java")) .assertMethod("multipartParams") - .assertParameter("_byte") - .hasType("String"); // Base64 multipart text → String + .assertParameter("bytes") + .hasType("String") // Base64 multipart text → String + .assertParameterAnnotations() + .containsWithName("RequestParam"); + + // Verifies that a binary file upload is exposed as MultipartFile + // and correctly bound from a multipart section using @RequestPart JavaFileAssert.assertThat(files.get("MultipartApi.java")) .assertMethod("multipartParams") .assertParameter("file") - .hasType("MultipartFile"); // binary file upload → MultipartFile + .hasType("MultipartFile") // binary file upload → MultipartFile + .assertParameterAnnotations() + .containsWithName("RequestPart"); // Form request DTO: JSON or form object mapping JavaFileAssert.assertThat(files.get("FormParamsRequest.java")) .assertProperty("plain") .withType("String"); // text property → String JavaFileAssert.assertThat(files.get("FormParamsRequest.java")) - .assertProperty("_byte") + .assertProperty("bytes") .isArray() .withType("byte"); // Base64 property in DTO → auto-decoded to byte[] diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java index 12d52f58de59..d74da75037f0 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/kotlin/spring/KotlinSpringServerCodegenTest.java @@ -602,6 +602,28 @@ public void skipDefaultInterface() throws Exception { ); } + @Test(description = "test skip default interface") + public void skipDefaultIgfdgdnterface() throws Exception { + File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); + output.deleteOnExit(); + String outputPath = output.getAbsolutePath().replace('\\', '/'); + + KotlinSpringServerCodegen codegen = new KotlinSpringServerCodegen(); + codegen.setOutputDir(output.getAbsolutePath()); + codegen.additionalProperties().put(KotlinSpringServerCodegen.INTERFACE_ONLY, true); + codegen.additionalProperties().put(KotlinSpringServerCodegen.SKIP_DEFAULT_INTERFACE, true); + + new DefaultGenerator().opts(new ClientOptInput() + .openAPI(TestUtils.parseSpec("src/test/resources/3_0/kotlin/byte-format-edge-cases.yaml")) + .config(codegen)) + .generate(); + + assertFileNotContains( + Paths.get(outputPath + "/src/main/kotlin/org/openapitools/api/PingApi.kt"), + "return " + ); + } + @Test(description = "test cookie parameter generation on interface apis") public void cookieParameterGenerationApis() throws Exception { File output = Files.createTempDirectory("test").toFile().getCanonicalFile(); diff --git a/modules/openapi-generator/src/test/resources/3_0/kotlin/byte-format-edge-cases.yaml b/modules/openapi-generator/src/test/resources/3_0/kotlin/byte-format-edge-cases.yaml new file mode 100644 index 000000000000..437458591083 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/kotlin/byte-format-edge-cases.yaml @@ -0,0 +1,157 @@ +openapi: 3.0.3 +info: + title: Byte Format Edge Cases + version: 1.0.0 + +paths: + /query: + get: + operationId: queryParams + summary: Query parameters + parameters: + - name: plain + in: query + schema: + type: string + - name: byte + in: query + schema: + type: string + format: byte + responses: + '204': + description: No content + + /path/{plain}/{byte}: + get: + operationId: pathParams + summary: Path parameters + parameters: + - name: plain + in: path + required: true + schema: + type: string + - name: byte + in: path + required: true + schema: + type: string + format: byte + responses: + '204': + description: No content + + /header: + get: + operationId: headerParams + summary: Header parameters + parameters: + - name: X-Plain + in: header + schema: + type: string + - name: X-Byte + in: header + schema: + type: string + format: byte + responses: + '204': + description: No content + + /cookie: + get: + operationId: cookieParams + summary: Cookie parameters + parameters: + - name: plain + in: cookie + schema: + type: string + - name: byte + in: cookie + schema: + type: string + format: byte + responses: + '204': + description: No content + + /form: + post: + operationId: formParams + summary: application/x-www-form-urlencoded + requestBody: + required: true + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + plain: + type: string + byte: + type: string + format: byte + responses: + '204': + description: No content + + /multipart: + post: + operationId: multipartParams + summary: multipart/form-data + requestBody: + required: true + content: + multipart/form-data: + schema: + type: object + properties: + plain: + type: string + byte: + type: string + format: byte + file: + type: string + format: binary + responses: + '204': + description: No content + + /json-body: + post: + operationId: jsonBody + summary: JSON request body + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + plain: + type: string + byte: + type: string + format: byte + responses: + '204': + description: No content + + /binary-body: + post: + operationId: binaryBody + summary: Raw binary body + requestBody: + required: true + content: + application/octet-stream: + schema: + type: string + format: binary + responses: + '204': + description: No content diff --git a/modules/openapi-generator/src/test/resources/3_0/spring/byte-format-edge-cases.yaml b/modules/openapi-generator/src/test/resources/3_0/spring/byte-format-edge-cases.yaml index 437458591083..03787495f731 100644 --- a/modules/openapi-generator/src/test/resources/3_0/spring/byte-format-edge-cases.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/spring/byte-format-edge-cases.yaml @@ -13,7 +13,7 @@ paths: in: query schema: type: string - - name: byte + - name: bytes in: query schema: type: string @@ -22,7 +22,7 @@ paths: '204': description: No content - /path/{plain}/{byte}: + /path/{plain}/{bytes}: get: operationId: pathParams summary: Path parameters @@ -32,7 +32,7 @@ paths: required: true schema: type: string - - name: byte + - name: bytes in: path required: true schema: @@ -69,7 +69,7 @@ paths: in: cookie schema: type: string - - name: byte + - name: bytes in: cookie schema: type: string @@ -91,7 +91,7 @@ paths: properties: plain: type: string - byte: + bytes: type: string format: byte responses: @@ -111,7 +111,7 @@ paths: properties: plain: type: string - byte: + bytes: type: string format: byte file: @@ -134,7 +134,7 @@ paths: properties: plain: type: string - byte: + bytes: type: string format: byte responses: diff --git a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java index 3bf17985d294..dca9125effd6 100644 --- a/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/spring-http-interface-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java @@ -259,7 +259,7 @@ void testEnumParameters( @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @RequestParam(value = "enum_query_integer", required = false) @Nullable Integer enumQueryInteger, @RequestParam(value = "enum_query_double", required = false) @Nullable Double enumQueryDouble, - @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @RequestParam(value = "enum_form_string_array", required = false) List enumFormStringArray, @RequestParam(value = "enum_form_string", required = false) String enumFormString ); diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java index 01dadd17b2f3..f5605756718b 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java @@ -217,20 +217,20 @@ Mono testClientModel( contentType = "application/x-www-form-urlencoded" ) Mono testEndpointParameters( - @RequestPart(value = "number", required = true) BigDecimal number, - @RequestPart(value = "double", required = true) Double _double, - @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @RequestPart(value = "byte", required = true) String _byte /* base64 encoded binary */, - @RequestPart(value = "integer", required = false) Integer integer, - @RequestPart(value = "int32", required = false) Integer int32, - @RequestPart(value = "int64", required = false) Long int64, - @RequestPart(value = "float", required = false) Float _float, - @RequestPart(value = "string", required = false) String string, + @RequestParam(value = "number", required = true) BigDecimal number, + @RequestParam(value = "double", required = true) Double _double, + @RequestParam(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + @RequestParam(value = "byte", required = true) String _byte /* base64 encoded binary */, + @RequestParam(value = "integer", required = false) Integer integer, + @RequestParam(value = "int32", required = false) Integer int32, + @RequestParam(value = "int64", required = false) Long int64, + @RequestParam(value = "float", required = false) Float _float, + @RequestParam(value = "string", required = false) String string, @RequestPart(value = "binary", required = false) Part binary, - @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @RequestPart(value = "password", required = false) String password, - @RequestPart(value = "callback", required = false) String paramCallback + @RequestParam(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @RequestParam(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @RequestParam(value = "password", required = false) String password, + @RequestParam(value = "callback", required = false) String paramCallback ); @@ -263,8 +263,8 @@ Mono testEnumParameters( @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @RequestParam(value = "enum_query_integer", required = false) @Nullable Integer enumQueryInteger, @RequestParam(value = "enum_query_double", required = false) @Nullable Double enumQueryDouble, - @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, - @RequestPart(value = "enum_form_string", required = false) String enumFormString + @RequestParam(value = "enum_form_string_array", required = false) List enumFormStringArray, + @RequestParam(value = "enum_form_string", required = false) String enumFormString ); @@ -331,8 +331,8 @@ Mono testInlineAdditionalProperties( contentType = "application/x-www-form-urlencoded" ) Mono testJsonFormData( - @RequestPart(value = "param", required = true) String param, - @RequestPart(value = "param2", required = true) String param2 + @RequestParam(value = "param", required = true) String param, + @RequestParam(value = "param2", required = true) String param2 ); diff --git a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/PetApi.java index ecd126897323..10736dc0251c 100644 --- a/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/api/PetApi.java @@ -186,8 +186,8 @@ Mono updatePet( ) Mono updatePetWithForm( @PathVariable("petId") Long petId, - @RequestPart(value = "name", required = false) String name, - @RequestPart(value = "status", required = false) String status + @RequestParam(value = "name", required = false) String name, + @RequestParam(value = "status", required = false) String status ); @@ -209,7 +209,7 @@ Mono updatePetWithForm( ) Mono uploadFile( @PathVariable("petId") Long petId, - @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @RequestPart(value = "file", required = false) Part file ); @@ -233,7 +233,7 @@ Mono uploadFile( Mono uploadFileWithRequiredFile( @PathVariable("petId") Long petId, @RequestPart(value = "requiredFile", required = true) Part requiredFile, - @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata + @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata ); } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeApi.java index 64340c50a182..ec1d768f7ac5 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeApi.java @@ -208,20 +208,20 @@ Mono> testClientModel( contentType = "application/x-www-form-urlencoded" ) Mono> testEndpointParameters( - @RequestPart(value = "number", required = true) BigDecimal number, - @RequestPart(value = "double", required = true) Double _double, - @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @RequestPart(value = "byte", required = true) String _byte /* base64 encoded binary */, - @RequestPart(value = "integer", required = false) Integer integer, - @RequestPart(value = "int32", required = false) Integer int32, - @RequestPart(value = "int64", required = false) Long int64, - @RequestPart(value = "float", required = false) Float _float, - @RequestPart(value = "string", required = false) String string, + @RequestParam(value = "number", required = true) BigDecimal number, + @RequestParam(value = "double", required = true) Double _double, + @RequestParam(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + @RequestParam(value = "byte", required = true) String _byte /* base64 encoded binary */, + @RequestParam(value = "integer", required = false) Integer integer, + @RequestParam(value = "int32", required = false) Integer int32, + @RequestParam(value = "int64", required = false) Long int64, + @RequestParam(value = "float", required = false) Float _float, + @RequestParam(value = "string", required = false) String string, @RequestPart(value = "binary", required = false) Part binary, - @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @RequestPart(value = "password", required = false) String password, - @RequestPart(value = "callback", required = false) String paramCallback + @RequestParam(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @RequestParam(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @RequestParam(value = "password", required = false) String password, + @RequestParam(value = "callback", required = false) String paramCallback ); @@ -253,8 +253,8 @@ Mono> testEnumParameters( @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @RequestParam(value = "enum_query_integer", required = false) @Nullable Integer enumQueryInteger, @RequestParam(value = "enum_query_double", required = false) @Nullable Double enumQueryDouble, - @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, - @RequestPart(value = "enum_form_string", required = false) String enumFormString + @RequestParam(value = "enum_form_string_array", required = false) List enumFormStringArray, + @RequestParam(value = "enum_form_string", required = false) String enumFormString ); @@ -318,8 +318,8 @@ Mono> testInlineAdditionalProperties( contentType = "application/x-www-form-urlencoded" ) Mono> testJsonFormData( - @RequestPart(value = "param", required = true) String param, - @RequestPart(value = "param2", required = true) String param2 + @RequestParam(value = "param", required = true) String param, + @RequestParam(value = "param2", required = true) String param2 ); diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/PetApi.java index fd584ea831df..58245d4f73bc 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/PetApi.java @@ -178,8 +178,8 @@ Mono> updatePet( ) Mono> updatePetWithForm( @PathVariable("petId") Long petId, - @RequestPart(value = "name", required = false) String name, - @RequestPart(value = "status", required = false) String status + @RequestParam(value = "name", required = false) String name, + @RequestParam(value = "status", required = false) String status ); @@ -200,7 +200,7 @@ Mono> updatePetWithForm( ) Mono> uploadFile( @PathVariable("petId") Long petId, - @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @RequestPart(value = "file", required = false) Part file ); @@ -223,7 +223,7 @@ Mono> uploadFile( Mono> uploadFileWithRequiredFile( @PathVariable("petId") Long petId, @RequestPart(value = "requiredFile", required = true) Part requiredFile, - @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata + @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata ); } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeApi.java index c5b0f02028f4..94dc809581c7 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeApi.java @@ -249,7 +249,7 @@ ResponseEntity testEnumParameters( @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @RequestParam(value = "enum_query_integer", required = false) @Nullable Integer enumQueryInteger, @RequestParam(value = "enum_query_double", required = false) @Nullable Double enumQueryDouble, - @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @RequestParam(value = "enum_form_string_array", required = false) List enumFormStringArray, @RequestParam(value = "enum_form_string", required = false) String enumFormString ); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java index 2440174d36c8..132f9d70de8e 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java @@ -367,7 +367,7 @@ ResponseEntity testEnumParameters( @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_integer", required = false) @Nullable Integer enumQueryInteger, @Parameter(name = "enum_query_double", description = "Query parameter enum test (double)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_double", required = false) @Nullable Double enumQueryDouble, - @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)") @Valid @RequestParam(value = "enum_form_string_array", required = false) List enumFormStringArray, @Parameter(name = "enum_form_string", description = "Form parameter enum test (string)") @Valid @RequestParam(value = "enum_form_string", required = false) String enumFormString ); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java index 0a173336a649..9182ad4c669e 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java @@ -418,7 +418,7 @@ default ResponseEntity testEnumParameters( @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_integer", required = false) @Nullable Integer enumQueryInteger, @Parameter(name = "enum_query_double", description = "Query parameter enum test (double)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_double", required = false) @Nullable Double enumQueryDouble, - @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)") @Valid @RequestParam(value = "enum_form_string_array", required = false) List enumFormStringArray, @Parameter(name = "enum_form_string", description = "Form parameter enum test (string)") @Valid @RequestParam(value = "enum_form_string", required = false) String enumFormString ) { return getDelegate().testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java index 63ff33246137..638b2fb89783 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java @@ -459,7 +459,7 @@ default ResponseEntity testEnumParameters( @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_integer", required = false) @Nullable Integer enumQueryInteger, @Parameter(name = "enum_query_double", description = "Query parameter enum test (double)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_double", required = false) @Nullable Double enumQueryDouble, - @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)") @Valid @RequestParam(value = "enum_form_string_array", required = false) List enumFormStringArray, @Parameter(name = "enum_form_string", description = "Form parameter enum test (string)") @Valid @RequestParam(value = "enum_form_string", required = false) String enumFormString ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/api/FakeApi.java index 336c11e550aa..64ba48c3c47f 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/api/FakeApi.java @@ -395,7 +395,7 @@ ResponseEntity testEnumParameters( @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_integer", required = false) @Nullable Integer enumQueryInteger, @Parameter(name = "enum_query_double", description = "Query parameter enum test (double)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_double", required = false) @Nullable Double enumQueryDouble, - @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)") @Valid @RequestParam(value = "enum_form_string_array", required = false) List enumFormStringArray, @Parameter(name = "enum_form_string", description = "Form parameter enum test (string)") @Valid @RequestParam(value = "enum_form_string", required = false) String enumFormString ) throws Exception; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java index e7ad9c81d6c0..7b95f6ff88ea 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java @@ -451,7 +451,7 @@ default ResponseEntity testEnumParameters( @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) @Nullable Integer enumQueryInteger, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) @Nullable Double enumQueryDouble, - @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $", defaultValue = "$") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $", defaultValue = "$") @Valid @RequestParam(value = "enum_form_string_array", required = false) List enumFormStringArray, @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_form_string", required = false) String enumFormString ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java index e7ad9c81d6c0..7b95f6ff88ea 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java @@ -451,7 +451,7 @@ default ResponseEntity testEnumParameters( @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) @Nullable Integer enumQueryInteger, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) @Nullable Double enumQueryDouble, - @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $", defaultValue = "$") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $", defaultValue = "$") @Valid @RequestParam(value = "enum_form_string_array", required = false) List enumFormStringArray, @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_form_string", required = false) String enumFormString ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/FakeApi.java index ff8f738c7dbd..4a165d2c5f74 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/FakeApi.java @@ -451,7 +451,7 @@ default ResponseEntity testEnumParameters( @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) @Nullable Integer enumQueryInteger, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) @Nullable Double enumQueryDouble, - @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $", defaultValue = "$") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $", defaultValue = "$") @Valid @RequestParam(value = "enum_form_string_array", required = false) List enumFormStringArray, @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_form_string", required = false) String enumFormString ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java index a2bc246f4aa6..c02fa768c34c 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -410,7 +410,7 @@ default ResponseEntity testEnumParameters( @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) @Nullable Integer enumQueryInteger, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) @Nullable Double enumQueryDouble, - @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $", defaultValue = "$") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $", defaultValue = "$") @Valid @RequestParam(value = "enum_form_string_array", required = false) List enumFormStringArray, @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_form_string", required = false) String enumFormString ) { return getDelegate().testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java index a2bc246f4aa6..c02fa768c34c 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java @@ -410,7 +410,7 @@ default ResponseEntity testEnumParameters( @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) @Nullable Integer enumQueryInteger, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) @Nullable Double enumQueryDouble, - @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $", defaultValue = "$") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $", defaultValue = "$") @Valid @RequestParam(value = "enum_form_string_array", required = false) List enumFormStringArray, @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_form_string", required = false) String enumFormString ) { return getDelegate().testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java index 145f5dba11c7..9db7408dc15f 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java @@ -451,7 +451,7 @@ default ResponseEntity testEnumParameters( @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) @Nullable Integer enumQueryInteger, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) @Nullable Double enumQueryDouble, - @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $", defaultValue = "$") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $", defaultValue = "$") @Valid @RequestParam(value = "enum_form_string_array", required = false) List enumFormStringArray, @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_form_string", required = false) String enumFormString ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java index 3ae61fbceb5c..3b8a8f9675b2 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeApi.java @@ -377,20 +377,20 @@ default Mono testClientModel( ) @ResponseStatus(HttpStatus.BAD_REQUEST) default Mono testEndpointParameters( - @ApiParam(value = "None", required = true) @DecimalMin(value = "32.1") @DecimalMax(value = "543.2") @Valid @RequestPart(value = "number", required = true) BigDecimal number, - @ApiParam(value = "None", required = true) @DecimalMin(value = "67.8") @DecimalMax(value = "123.4") @Valid @RequestPart(value = "double", required = true) Double _double, - @ApiParam(value = "None", required = true) @Pattern(regexp = "^[A-Z].*") @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) String _byte /* base64 encoded binary */, - @ApiParam(value = "None") @Min(value = 10) @Max(value = 100) @Valid @RequestPart(value = "integer", required = false) Integer integer, - @ApiParam(value = "None") @Min(value = 20) @Max(value = 200) @Valid @RequestPart(value = "int32", required = false) Integer int32, - @ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, - @ApiParam(value = "None") @DecimalMax(value = "987.6") @Valid @RequestPart(value = "float", required = false) Float _float, - @ApiParam(value = "None") @Pattern(regexp = "/[a-z]/i") @Valid @RequestPart(value = "string", required = false) String string, + @ApiParam(value = "None", required = true) @DecimalMin(value = "32.1") @DecimalMax(value = "543.2") @Valid @RequestParam(value = "number", required = true) BigDecimal number, + @ApiParam(value = "None", required = true) @DecimalMin(value = "67.8") @DecimalMax(value = "123.4") @Valid @RequestParam(value = "double", required = true) Double _double, + @ApiParam(value = "None", required = true) @Pattern(regexp = "^[A-Z].*") @Valid @RequestParam(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "byte", required = true) String _byte /* base64 encoded binary */, + @ApiParam(value = "None") @Min(value = 10) @Max(value = 100) @Valid @RequestParam(value = "integer", required = false) Integer integer, + @ApiParam(value = "None") @Min(value = 20) @Max(value = 200) @Valid @RequestParam(value = "int32", required = false) Integer int32, + @ApiParam(value = "None") @Valid @RequestParam(value = "int64", required = false) Long int64, + @ApiParam(value = "None") @DecimalMax(value = "987.6") @Valid @RequestParam(value = "float", required = false) Float _float, + @ApiParam(value = "None") @Pattern(regexp = "/[a-z]/i") @Valid @RequestParam(value = "string", required = false) String string, @ApiParam(value = "None") @RequestPart(value = "binary", required = false) Part binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @ApiParam(value = "None") @Size(min = 10, max = 64) @Valid @RequestPart(value = "password", required = false) String password, - @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback, + @ApiParam(value = "None") @Valid @RequestParam(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @ApiParam(value = "None") @Valid @RequestParam(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @ApiParam(value = "None") @Size(min = 10, max = 64) @Valid @RequestParam(value = "password", required = false) String password, + @ApiParam(value = "None") @Valid @RequestParam(value = "callback", required = false) String paramCallback, @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, exchange); @@ -436,8 +436,8 @@ default Mono testEnumParameters( @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) @Nullable Integer enumQueryInteger, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) @Nullable Double enumQueryDouble, - @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $", defaultValue = "$") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString, + @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $", defaultValue = "$") @Valid @RequestParam(value = "enum_form_string_array", required = false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_form_string", required = false) String enumFormString, @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, exchange); @@ -540,8 +540,8 @@ default Mono testInlineAdditionalProperties( ) @ResponseStatus(HttpStatus.OK) default Mono testJsonFormData( - @ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, - @ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2, + @ApiParam(value = "field1", required = true) @Valid @RequestParam(value = "param", required = true) String param, + @ApiParam(value = "field2", required = true) @Valid @RequestParam(value = "param2", required = true) String param2, @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().testJsonFormData(param, param2, exchange); @@ -681,7 +681,7 @@ default Mono testWithResultExample( default Mono uploadFileWithRequiredFile( @NotNull @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) Part requiredFile, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata, exchange); diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/PetApi.java index 52c7a008228c..0cff979098ca 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/PetApi.java @@ -313,8 +313,8 @@ default Mono updatePet( @ResponseStatus(HttpStatus.METHOD_NOT_ALLOWED) default Mono updatePetWithForm( @NotNull @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, - @ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status, + @ApiParam(value = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, + @ApiParam(value = "Updated status of the pet") @Valid @RequestParam(value = "status", required = false) String status, @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().updatePetWithForm(petId, name, status, exchange); @@ -356,7 +356,7 @@ default Mono updatePetWithForm( @ResponseStatus(HttpStatus.OK) default Mono uploadFile( @NotNull @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) Part file, @ApiIgnore final ServerWebExchange exchange ) { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java index eb7cd4606012..379db00347b2 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java @@ -367,20 +367,20 @@ default Mono> testClientModel( consumes = { "application/x-www-form-urlencoded" } ) default Mono> testEndpointParameters( - @ApiParam(value = "None", required = true) @DecimalMin(value = "32.1") @DecimalMax(value = "543.2") @Valid @RequestPart(value = "number", required = true) BigDecimal number, - @ApiParam(value = "None", required = true) @DecimalMin(value = "67.8") @DecimalMax(value = "123.4") @Valid @RequestPart(value = "double", required = true) Double _double, - @ApiParam(value = "None", required = true) @Pattern(regexp = "^[A-Z].*") @Valid @RequestPart(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @ApiParam(value = "None", required = true) @Valid @RequestPart(value = "byte", required = true) String _byte /* base64 encoded binary */, - @ApiParam(value = "None") @Min(value = 10) @Max(value = 100) @Valid @RequestPart(value = "integer", required = false) Integer integer, - @ApiParam(value = "None") @Min(value = 20) @Max(value = 200) @Valid @RequestPart(value = "int32", required = false) Integer int32, - @ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, - @ApiParam(value = "None") @DecimalMax(value = "987.6") @Valid @RequestPart(value = "float", required = false) Float _float, - @ApiParam(value = "None") @Pattern(regexp = "/[a-z]/i") @Valid @RequestPart(value = "string", required = false) String string, + @ApiParam(value = "None", required = true) @DecimalMin(value = "32.1") @DecimalMax(value = "543.2") @Valid @RequestParam(value = "number", required = true) BigDecimal number, + @ApiParam(value = "None", required = true) @DecimalMin(value = "67.8") @DecimalMax(value = "123.4") @Valid @RequestParam(value = "double", required = true) Double _double, + @ApiParam(value = "None", required = true) @Pattern(regexp = "^[A-Z].*") @Valid @RequestParam(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, + @ApiParam(value = "None", required = true) @Valid @RequestParam(value = "byte", required = true) String _byte /* base64 encoded binary */, + @ApiParam(value = "None") @Min(value = 10) @Max(value = 100) @Valid @RequestParam(value = "integer", required = false) Integer integer, + @ApiParam(value = "None") @Min(value = 20) @Max(value = 200) @Valid @RequestParam(value = "int32", required = false) Integer int32, + @ApiParam(value = "None") @Valid @RequestParam(value = "int64", required = false) Long int64, + @ApiParam(value = "None") @DecimalMax(value = "987.6") @Valid @RequestParam(value = "float", required = false) Float _float, + @ApiParam(value = "None") @Pattern(regexp = "/[a-z]/i") @Valid @RequestParam(value = "string", required = false) String string, @ApiParam(value = "None") @RequestPart(value = "binary", required = false) Part binary, - @ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @ApiParam(value = "None") @Size(min = 10, max = 64) @Valid @RequestPart(value = "password", required = false) String password, - @ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback, + @ApiParam(value = "None") @Valid @RequestParam(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, + @ApiParam(value = "None") @Valid @RequestParam(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, + @ApiParam(value = "None") @Size(min = 10, max = 64) @Valid @RequestParam(value = "password", required = false) String password, + @ApiParam(value = "None") @Valid @RequestParam(value = "callback", required = false) String paramCallback, @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, exchange); @@ -425,8 +425,8 @@ default Mono> testEnumParameters( @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) @Nullable Integer enumQueryInteger, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) @Nullable Double enumQueryDouble, - @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $", defaultValue = "$") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, - @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestPart(value = "enum_form_string", required = false) String enumFormString, + @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $", defaultValue = "$") @Valid @RequestParam(value = "enum_form_string_array", required = false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_form_string", required = false) String enumFormString, @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, exchange); @@ -526,8 +526,8 @@ default Mono> testInlineAdditionalProperties( consumes = { "application/x-www-form-urlencoded" } ) default Mono> testJsonFormData( - @ApiParam(value = "field1", required = true) @Valid @RequestPart(value = "param", required = true) String param, - @ApiParam(value = "field2", required = true) @Valid @RequestPart(value = "param2", required = true) String param2, + @ApiParam(value = "field1", required = true) @Valid @RequestParam(value = "param", required = true) String param, + @ApiParam(value = "field2", required = true) @Valid @RequestParam(value = "param2", required = true) String param2, @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().testJsonFormData(param, param2, exchange); @@ -663,7 +663,7 @@ default Mono> testWithResultExample( default Mono> uploadFileWithRequiredFile( @NotNull @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, @ApiParam(value = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) Part requiredFile, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata, exchange); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java index e35ec3e59ee1..e49d8d126483 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java @@ -306,8 +306,8 @@ default Mono> updatePet( ) default Mono> updatePetWithForm( @NotNull @ApiParam(value = "ID of pet that needs to be updated", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Updated name of the pet") @Valid @RequestPart(value = "name", required = false) String name, - @ApiParam(value = "Updated status of the pet") @Valid @RequestPart(value = "status", required = false) String status, + @ApiParam(value = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, + @ApiParam(value = "Updated status of the pet") @Valid @RequestParam(value = "status", required = false) String status, @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().updatePetWithForm(petId, name, status, exchange); @@ -348,7 +348,7 @@ default Mono> updatePetWithForm( ) default Mono> uploadFile( @NotNull @ApiParam(value = "ID of pet to update", required = true) @PathVariable("petId") Long petId, - @ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, + @ApiParam(value = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) Part file, @ApiIgnore final ServerWebExchange exchange ) { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java index d8c8baf81d36..a0b036bd55b8 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -375,7 +375,7 @@ default ResponseEntity testEnumParameters( @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) @Nullable Integer enumQueryInteger, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) @Nullable Double enumQueryDouble, - @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $", defaultValue = "$") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $", defaultValue = "$") @Valid @RequestParam(value = "enum_form_string_array", required = false) List enumFormStringArray, @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_form_string", required = false) String enumFormString ) { return getDelegate().testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java index d8c8baf81d36..a0b036bd55b8 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java @@ -375,7 +375,7 @@ default ResponseEntity testEnumParameters( @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) @Nullable Integer enumQueryInteger, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) @Nullable Double enumQueryDouble, - @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $", defaultValue = "$") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $", defaultValue = "$") @Valid @RequestParam(value = "enum_form_string_array", required = false) List enumFormStringArray, @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_form_string", required = false) String enumFormString ) { return getDelegate().testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java index 3d40e76da48a..cb63dc4ea9d2 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -406,7 +406,7 @@ default ResponseEntity testEnumParameters( @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) @Nullable Integer enumQueryInteger, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) @Nullable Double enumQueryDouble, - @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $", defaultValue = "$") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $", defaultValue = "$") @Valid @RequestParam(value = "enum_form_string_array", required = false) List enumFormStringArray, @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_form_string", required = false) String enumFormString ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java index 3d40e76da48a..cb63dc4ea9d2 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java @@ -406,7 +406,7 @@ default ResponseEntity testEnumParameters( @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) @Nullable Integer enumQueryInteger, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) @Nullable Double enumQueryDouble, - @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $", defaultValue = "$") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $", defaultValue = "$") @Valid @RequestParam(value = "enum_form_string_array", required = false) List enumFormStringArray, @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_form_string", required = false) String enumFormString ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java index a83dc616fcb8..a31b015f10e8 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java @@ -451,7 +451,7 @@ default ResponseEntity testEnumParameters( @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") Optional enumQueryString, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) Optional enumQueryInteger, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Optional enumQueryDouble, - @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $", defaultValue = "$") @Valid @RequestPart(value = "enum_form_string_array", required = false) Optional> enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $", defaultValue = "$") @Valid @RequestParam(value = "enum_form_string_array", required = false) Optional> enumFormStringArray, @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_form_string", required = false) Optional enumFormString ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java index 230b6e57346f..d1a899d9c079 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java @@ -473,7 +473,7 @@ default ResponseEntity testEnumParameters( @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_integer", required = false) @Nullable Integer enumQueryInteger, @Parameter(name = "enum_query_double", description = "Query parameter enum test (double)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_double", required = false) @Nullable Double enumQueryDouble, - @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)") @Valid @RequestParam(value = "enum_form_string_array", required = false) List enumFormStringArray, @Parameter(name = "enum_form_string", description = "Form parameter enum test (string)") @Valid @RequestParam(value = "enum_form_string", required = false) String enumFormString ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeApi.java index ae1e007efe15..1c8f167cc04d 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeApi.java @@ -602,7 +602,7 @@ default ResponseEntity testEnumParameters( @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) @Nullable Integer enumQueryInteger, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) @Nullable Double enumQueryDouble, @ApiParam(value = "") @Valid @RequestParam(value = "enum_query_model_array", required = false) @Nullable List enumQueryModelArray, - @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $", defaultValue = "$") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $", defaultValue = "$") @Valid @RequestParam(value = "enum_form_string_array", required = false) List enumFormStringArray, @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_form_string", required = false) String enumFormString ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java index b6e35bd7ee45..801a0a064c74 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java @@ -451,7 +451,7 @@ default ResponseEntity testEnumParameters( @ApiParam(value = "Query parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1, -2") @Valid @RequestParam(value = "enum_query_integer", required = false) @Nullable Integer enumQueryInteger, @ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) @Nullable Double enumQueryDouble, - @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $", defaultValue = "$") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, + @ApiParam(value = "Form parameter enum test (string array)", allowableValues = ">, $", defaultValue = "$") @Valid @RequestParam(value = "enum_form_string_array", required = false) List enumFormStringArray, @ApiParam(value = "Form parameter enum test (string)", allowableValues = "_abc, -efg, (xyz)", defaultValue = "-efg") @Valid @RequestParam(value = "enum_form_string", required = false) String enumFormString ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); From e78800b672535d492409943a94b681b095f83f22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1chym=20Metli=C4=8Dka?= Date: Tue, 10 Feb 2026 09:26:37 +0100 Subject: [PATCH 5/7] add sample --- .../.openapi-generator-ignore | 23 +++ .../.openapi-generator/FILES | 28 +++ .../.openapi-generator/VERSION | 1 + .../README.md | 21 ++ .../springboot-byte-format-edge-cases/pom.xml | 82 ++++++++ .../OpenApiGeneratorApplication.java | 30 +++ .../org/openapitools/RFC3339DateFormat.java | 38 ++++ .../java/org/openapitools/api/ApiUtil.java | 21 ++ .../org/openapitools/api/BinaryBodyApi.java | 70 +++++++ .../api/BinaryBodyApiController.java | 45 ++++ .../java/org/openapitools/api/CookieApi.java | 72 +++++++ .../openapitools/api/CookieApiController.java | 46 +++++ .../java/org/openapitools/api/FormApi.java | 73 +++++++ .../openapitools/api/FormApiController.java | 46 +++++ .../java/org/openapitools/api/HeaderApi.java | 72 +++++++ .../openapitools/api/HeaderApiController.java | 46 +++++ .../org/openapitools/api/JsonBodyApi.java | 71 +++++++ .../api/JsonBodyApiController.java | 46 +++++ .../org/openapitools/api/MultipartApi.java | 75 +++++++ .../api/MultipartApiController.java | 46 +++++ .../java/org/openapitools/api/PathApi.java | 71 +++++++ .../openapitools/api/PathApiController.java | 45 ++++ .../java/org/openapitools/api/QueryApi.java | 72 +++++++ .../openapitools/api/QueryApiController.java | 46 +++++ .../configuration/HomeController.java | 20 ++ .../configuration/SpringDocConfiguration.java | 27 +++ .../openapitools/model/FormParamsRequest.java | 111 ++++++++++ .../src/main/resources/application.properties | 3 + .../src/main/resources/openapi.yaml | 193 ++++++++++++++++++ .../OpenApiGeneratorApplicationTests.java | 13 ++ 30 files changed, 1553 insertions(+) create mode 100644 samples/server/petstore/springboot-byte-format-edge-cases/.openapi-generator-ignore create mode 100644 samples/server/petstore/springboot-byte-format-edge-cases/.openapi-generator/FILES create mode 100644 samples/server/petstore/springboot-byte-format-edge-cases/.openapi-generator/VERSION create mode 100644 samples/server/petstore/springboot-byte-format-edge-cases/README.md create mode 100644 samples/server/petstore/springboot-byte-format-edge-cases/pom.xml create mode 100644 samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/OpenApiGeneratorApplication.java create mode 100644 samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/RFC3339DateFormat.java create mode 100644 samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/ApiUtil.java create mode 100644 samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/BinaryBodyApi.java create mode 100644 samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/BinaryBodyApiController.java create mode 100644 samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/CookieApi.java create mode 100644 samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/CookieApiController.java create mode 100644 samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/FormApi.java create mode 100644 samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/FormApiController.java create mode 100644 samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/HeaderApi.java create mode 100644 samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/HeaderApiController.java create mode 100644 samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/JsonBodyApi.java create mode 100644 samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/JsonBodyApiController.java create mode 100644 samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/MultipartApi.java create mode 100644 samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/MultipartApiController.java create mode 100644 samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/PathApi.java create mode 100644 samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/PathApiController.java create mode 100644 samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/QueryApi.java create mode 100644 samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/QueryApiController.java create mode 100644 samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/configuration/HomeController.java create mode 100644 samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java create mode 100644 samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/model/FormParamsRequest.java create mode 100644 samples/server/petstore/springboot-byte-format-edge-cases/src/main/resources/application.properties create mode 100644 samples/server/petstore/springboot-byte-format-edge-cases/src/main/resources/openapi.yaml create mode 100644 samples/server/petstore/springboot-byte-format-edge-cases/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java diff --git a/samples/server/petstore/springboot-byte-format-edge-cases/.openapi-generator-ignore b/samples/server/petstore/springboot-byte-format-edge-cases/.openapi-generator-ignore new file mode 100644 index 000000000000..7484ee590a38 --- /dev/null +++ b/samples/server/petstore/springboot-byte-format-edge-cases/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/server/petstore/springboot-byte-format-edge-cases/.openapi-generator/FILES b/samples/server/petstore/springboot-byte-format-edge-cases/.openapi-generator/FILES new file mode 100644 index 000000000000..6901defe40b3 --- /dev/null +++ b/samples/server/petstore/springboot-byte-format-edge-cases/.openapi-generator/FILES @@ -0,0 +1,28 @@ +.openapi-generator-ignore +README.md +pom.xml +src/main/java/org/openapitools/OpenApiGeneratorApplication.java +src/main/java/org/openapitools/RFC3339DateFormat.java +src/main/java/org/openapitools/api/ApiUtil.java +src/main/java/org/openapitools/api/BinaryBodyApi.java +src/main/java/org/openapitools/api/BinaryBodyApiController.java +src/main/java/org/openapitools/api/CookieApi.java +src/main/java/org/openapitools/api/CookieApiController.java +src/main/java/org/openapitools/api/FormApi.java +src/main/java/org/openapitools/api/FormApiController.java +src/main/java/org/openapitools/api/HeaderApi.java +src/main/java/org/openapitools/api/HeaderApiController.java +src/main/java/org/openapitools/api/JsonBodyApi.java +src/main/java/org/openapitools/api/JsonBodyApiController.java +src/main/java/org/openapitools/api/MultipartApi.java +src/main/java/org/openapitools/api/MultipartApiController.java +src/main/java/org/openapitools/api/PathApi.java +src/main/java/org/openapitools/api/PathApiController.java +src/main/java/org/openapitools/api/QueryApi.java +src/main/java/org/openapitools/api/QueryApiController.java +src/main/java/org/openapitools/configuration/HomeController.java +src/main/java/org/openapitools/configuration/SpringDocConfiguration.java +src/main/java/org/openapitools/model/FormParamsRequest.java +src/main/resources/application.properties +src/main/resources/openapi.yaml +src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java diff --git a/samples/server/petstore/springboot-byte-format-edge-cases/.openapi-generator/VERSION b/samples/server/petstore/springboot-byte-format-edge-cases/.openapi-generator/VERSION new file mode 100644 index 000000000000..193a12d6e891 --- /dev/null +++ b/samples/server/petstore/springboot-byte-format-edge-cases/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.20.0-SNAPSHOT diff --git a/samples/server/petstore/springboot-byte-format-edge-cases/README.md b/samples/server/petstore/springboot-byte-format-edge-cases/README.md new file mode 100644 index 000000000000..5cd22b6081a2 --- /dev/null +++ b/samples/server/petstore/springboot-byte-format-edge-cases/README.md @@ -0,0 +1,21 @@ +# OpenAPI generated server + +Spring Boot Server + +## Overview +This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. +By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. +This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. + + +The underlying library integrating OpenAPI to Spring Boot is [springdoc](https://springdoc.org). +Springdoc will generate an OpenAPI v3 specification based on the generated Controller and Model classes. +The specification is available to download using the following url: +http://localhost:8080/v3/api-docs/ + +Start your server as a simple java application + +You can view the api documentation in swagger-ui by pointing to +http://localhost:8080/swagger-ui.html + +Change default port value in application.properties \ No newline at end of file diff --git a/samples/server/petstore/springboot-byte-format-edge-cases/pom.xml b/samples/server/petstore/springboot-byte-format-edge-cases/pom.xml new file mode 100644 index 000000000000..b3ab46e3b81f --- /dev/null +++ b/samples/server/petstore/springboot-byte-format-edge-cases/pom.xml @@ -0,0 +1,82 @@ + + 4.0.0 + org.openapitools + springboot + jar + springboot + 1.0.0-SNAPSHOT + + 1.8 + ${java.version} + ${java.version} + UTF-8 + 1.6.14 + 5.3.1 + + + org.springframework.boot + spring-boot-starter-parent + 2.7.15 + + + + src/main/java + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.data + spring-data-commons + + + + org.springdoc + springdoc-openapi-ui + ${springdoc.version} + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + com.fasterxml.jackson.dataformat + jackson-dataformat-yaml + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + + + org.openapitools + jackson-databind-nullable + 0.2.8 + + + + org.springframework.boot + spring-boot-starter-validation + + + com.fasterxml.jackson.core + jackson-databind + + + org.springframework.boot + spring-boot-starter-test + test + + + diff --git a/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/OpenApiGeneratorApplication.java new file mode 100644 index 000000000000..97252a8a9402 --- /dev/null +++ b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/OpenApiGeneratorApplication.java @@ -0,0 +1,30 @@ +package org.openapitools; + +import com.fasterxml.jackson.databind.Module; +import org.openapitools.jackson.nullable.JsonNullableModule; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.FilterType; +import org.springframework.context.annotation.FullyQualifiedAnnotationBeanNameGenerator; + +@SpringBootApplication( + nameGenerator = FullyQualifiedAnnotationBeanNameGenerator.class +) +@ComponentScan( + basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}, + nameGenerator = FullyQualifiedAnnotationBeanNameGenerator.class +) +public class OpenApiGeneratorApplication { + + public static void main(String[] args) { + SpringApplication.run(OpenApiGeneratorApplication.class, args); + } + + @Bean(name = "org.openapitools.OpenApiGeneratorApplication.jsonNullableModule") + public Module jsonNullableModule() { + return new JsonNullableModule(); + } + +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/RFC3339DateFormat.java b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/RFC3339DateFormat.java new file mode 100644 index 000000000000..bcd3936d8b34 --- /dev/null +++ b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/RFC3339DateFormat.java @@ -0,0 +1,38 @@ +package org.openapitools; + +import com.fasterxml.jackson.databind.util.StdDateFormat; + +import java.text.DateFormat; +import java.text.FieldPosition; +import java.text.ParsePosition; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.TimeZone; + +public class RFC3339DateFormat extends DateFormat { + private static final long serialVersionUID = 1L; + private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); + + private final StdDateFormat fmt = new StdDateFormat() + .withTimeZone(TIMEZONE_Z) + .withColonInTimeZone(true); + + public RFC3339DateFormat() { + this.calendar = new GregorianCalendar(); + } + + @Override + public Date parse(String source, ParsePosition pos) { + return fmt.parse(source, pos); + } + + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + return fmt.format(date, toAppendTo, fieldPosition); + } + + @Override + public Object clone() { + return this; + } +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/ApiUtil.java b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/ApiUtil.java new file mode 100644 index 000000000000..c03486e4081d --- /dev/null +++ b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/ApiUtil.java @@ -0,0 +1,21 @@ +package org.openapitools.api; + +import org.springframework.web.context.request.NativeWebRequest; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +public class ApiUtil { + public static void setExampleResponse(NativeWebRequest req, String contentType, String example) { + try { + HttpServletResponse res = req.getNativeResponse(HttpServletResponse.class); + if (res != null) { + res.setCharacterEncoding("UTF-8"); + res.addHeader("Content-Type", contentType); + res.getWriter().print(example); + } + } catch (IOException e) { + throw new RuntimeException(e); + } + } +} diff --git a/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/BinaryBodyApi.java b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/BinaryBodyApi.java new file mode 100644 index 000000000000..81b2701789ca --- /dev/null +++ b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/BinaryBodyApi.java @@ -0,0 +1,70 @@ +/* + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.20.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import io.swagger.v3.oas.annotations.ExternalDocumentation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +@Validated +@Tag(name = "binary-body", description = "the binary-body API") +public interface BinaryBodyApi { + + default Optional getRequest() { + return Optional.empty(); + } + + String PATH_BINARY_BODY = "/binary-body"; + /** + * POST /binary-body : Raw binary body + * + * @param body (required) + * @return No content (status code 204) + */ + @Operation( + operationId = "binaryBody", + summary = "Raw binary body", + responses = { + @ApiResponse(responseCode = "204", description = "No content") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = BinaryBodyApi.PATH_BINARY_BODY, + consumes = { "application/octet-stream" } + ) + default ResponseEntity binaryBody( + @Parameter(name = "body", description = "", required = true) @Valid @RequestBody org.springframework.core.io.Resource body + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/BinaryBodyApiController.java b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/BinaryBodyApiController.java new file mode 100644 index 000000000000..9f7925332248 --- /dev/null +++ b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/BinaryBodyApiController.java @@ -0,0 +1,45 @@ +package org.openapitools.api; + + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +@Controller +@RequestMapping("${openapi.byteFormatEdgeCases.base-path:}") +public class BinaryBodyApiController implements BinaryBodyApi { + + private final NativeWebRequest request; + + @Autowired + public BinaryBodyApiController(NativeWebRequest request) { + this.request = request; + } + + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + +} diff --git a/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/CookieApi.java b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/CookieApi.java new file mode 100644 index 000000000000..055c4198e6c3 --- /dev/null +++ b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/CookieApi.java @@ -0,0 +1,72 @@ +/* + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.20.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import org.springframework.lang.Nullable; +import io.swagger.v3.oas.annotations.ExternalDocumentation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +@Validated +@Tag(name = "cookie", description = "the cookie API") +public interface CookieApi { + + default Optional getRequest() { + return Optional.empty(); + } + + String PATH_COOKIE_PARAMS = "/cookie"; + /** + * GET /cookie : Cookie parameters + * + * @param plain (optional) + * @param bytes (optional) + * @return No content (status code 204) + */ + @Operation( + operationId = "cookieParams", + summary = "Cookie parameters", + responses = { + @ApiResponse(responseCode = "204", description = "No content") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = CookieApi.PATH_COOKIE_PARAMS + ) + default ResponseEntity cookieParams( + @Parameter(name = "plain", description = "", in = ParameterIn.COOKIE) @CookieValue(name = "plain", required = false) @Nullable String plain, + @Parameter(name = "bytes", description = "", in = ParameterIn.COOKIE) @CookieValue(name = "bytes", required = false) @Nullable String bytes /* base64 encoded binary */ + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/CookieApiController.java b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/CookieApiController.java new file mode 100644 index 000000000000..3bdf313d4f24 --- /dev/null +++ b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/CookieApiController.java @@ -0,0 +1,46 @@ +package org.openapitools.api; + +import org.springframework.lang.Nullable; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +@Controller +@RequestMapping("${openapi.byteFormatEdgeCases.base-path:}") +public class CookieApiController implements CookieApi { + + private final NativeWebRequest request; + + @Autowired + public CookieApiController(NativeWebRequest request) { + this.request = request; + } + + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + +} diff --git a/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/FormApi.java b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/FormApi.java new file mode 100644 index 000000000000..a03c9992b73b --- /dev/null +++ b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/FormApi.java @@ -0,0 +1,73 @@ +/* + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.20.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import org.springframework.lang.Nullable; +import io.swagger.v3.oas.annotations.ExternalDocumentation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +@Validated +@Tag(name = "form", description = "the form API") +public interface FormApi { + + default Optional getRequest() { + return Optional.empty(); + } + + String PATH_FORM_PARAMS = "/form"; + /** + * POST /form : application/x-www-form-urlencoded + * + * @param plain (optional) + * @param bytes (optional) + * @return No content (status code 204) + */ + @Operation( + operationId = "formParams", + summary = "application/x-www-form-urlencoded", + responses = { + @ApiResponse(responseCode = "204", description = "No content") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = FormApi.PATH_FORM_PARAMS, + consumes = { "application/x-www-form-urlencoded" } + ) + default ResponseEntity formParams( + @Parameter(name = "plain", description = "") @Valid @RequestParam(value = "plain", required = false) String plain, + @Parameter(name = "bytes", description = "") @Valid @RequestParam(value = "bytes", required = false) String bytes /* base64 encoded binary */ + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/FormApiController.java b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/FormApiController.java new file mode 100644 index 000000000000..648b978ccfb8 --- /dev/null +++ b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/FormApiController.java @@ -0,0 +1,46 @@ +package org.openapitools.api; + +import org.springframework.lang.Nullable; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +@Controller +@RequestMapping("${openapi.byteFormatEdgeCases.base-path:}") +public class FormApiController implements FormApi { + + private final NativeWebRequest request; + + @Autowired + public FormApiController(NativeWebRequest request) { + this.request = request; + } + + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + +} diff --git a/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/HeaderApi.java b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/HeaderApi.java new file mode 100644 index 000000000000..ecbfa0f23b5b --- /dev/null +++ b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/HeaderApi.java @@ -0,0 +1,72 @@ +/* + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.20.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import org.springframework.lang.Nullable; +import io.swagger.v3.oas.annotations.ExternalDocumentation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +@Validated +@Tag(name = "header", description = "the header API") +public interface HeaderApi { + + default Optional getRequest() { + return Optional.empty(); + } + + String PATH_HEADER_PARAMS = "/header"; + /** + * GET /header : Header parameters + * + * @param xPlain (optional) + * @param xByte (optional) + * @return No content (status code 204) + */ + @Operation( + operationId = "headerParams", + summary = "Header parameters", + responses = { + @ApiResponse(responseCode = "204", description = "No content") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = HeaderApi.PATH_HEADER_PARAMS + ) + default ResponseEntity headerParams( + @Parameter(name = "X-Plain", description = "", in = ParameterIn.HEADER) @RequestHeader(value = "X-Plain", required = false) @Nullable String xPlain, + @Parameter(name = "X-Byte", description = "", in = ParameterIn.HEADER) @RequestHeader(value = "X-Byte", required = false) @Nullable String xByte /* base64 encoded binary */ + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/HeaderApiController.java b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/HeaderApiController.java new file mode 100644 index 000000000000..c477c791bb45 --- /dev/null +++ b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/HeaderApiController.java @@ -0,0 +1,46 @@ +package org.openapitools.api; + +import org.springframework.lang.Nullable; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +@Controller +@RequestMapping("${openapi.byteFormatEdgeCases.base-path:}") +public class HeaderApiController implements HeaderApi { + + private final NativeWebRequest request; + + @Autowired + public HeaderApiController(NativeWebRequest request) { + this.request = request; + } + + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + +} diff --git a/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/JsonBodyApi.java b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/JsonBodyApi.java new file mode 100644 index 000000000000..4107748ab91b --- /dev/null +++ b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/JsonBodyApi.java @@ -0,0 +1,71 @@ +/* + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.20.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import org.openapitools.model.FormParamsRequest; +import io.swagger.v3.oas.annotations.ExternalDocumentation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +@Validated +@Tag(name = "json-body", description = "the json-body API") +public interface JsonBodyApi { + + default Optional getRequest() { + return Optional.empty(); + } + + String PATH_JSON_BODY = "/json-body"; + /** + * POST /json-body : JSON request body + * + * @param formParamsRequest (required) + * @return No content (status code 204) + */ + @Operation( + operationId = "jsonBody", + summary = "JSON request body", + responses = { + @ApiResponse(responseCode = "204", description = "No content") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = JsonBodyApi.PATH_JSON_BODY, + consumes = { "application/json" } + ) + default ResponseEntity jsonBody( + @Parameter(name = "FormParamsRequest", description = "", required = true) @Valid @RequestBody FormParamsRequest formParamsRequest + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/JsonBodyApiController.java b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/JsonBodyApiController.java new file mode 100644 index 000000000000..1f3ab311ceb8 --- /dev/null +++ b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/JsonBodyApiController.java @@ -0,0 +1,46 @@ +package org.openapitools.api; + +import org.openapitools.model.FormParamsRequest; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +@Controller +@RequestMapping("${openapi.byteFormatEdgeCases.base-path:}") +public class JsonBodyApiController implements JsonBodyApi { + + private final NativeWebRequest request; + + @Autowired + public JsonBodyApiController(NativeWebRequest request) { + this.request = request; + } + + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + +} diff --git a/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/MultipartApi.java b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/MultipartApi.java new file mode 100644 index 000000000000..07203b6e7b24 --- /dev/null +++ b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/MultipartApi.java @@ -0,0 +1,75 @@ +/* + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.20.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import org.springframework.lang.Nullable; +import io.swagger.v3.oas.annotations.ExternalDocumentation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +@Validated +@Tag(name = "multipart", description = "the multipart API") +public interface MultipartApi { + + default Optional getRequest() { + return Optional.empty(); + } + + String PATH_MULTIPART_PARAMS = "/multipart"; + /** + * POST /multipart : multipart/form-data + * + * @param plain (optional) + * @param bytes (optional) + * @param file (optional) + * @return No content (status code 204) + */ + @Operation( + operationId = "multipartParams", + summary = "multipart/form-data", + responses = { + @ApiResponse(responseCode = "204", description = "No content") + } + ) + @RequestMapping( + method = RequestMethod.POST, + value = MultipartApi.PATH_MULTIPART_PARAMS, + consumes = { "multipart/form-data" } + ) + default ResponseEntity multipartParams( + @Parameter(name = "plain", description = "") @Valid @RequestParam(value = "plain", required = false) String plain, + @Parameter(name = "bytes", description = "") @Valid @RequestParam(value = "bytes", required = false) String bytes /* base64 encoded binary */, + @Parameter(name = "file", description = "") @RequestPart(value = "file", required = false) MultipartFile file + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/MultipartApiController.java b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/MultipartApiController.java new file mode 100644 index 000000000000..d8dfa5d15b31 --- /dev/null +++ b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/MultipartApiController.java @@ -0,0 +1,46 @@ +package org.openapitools.api; + +import org.springframework.lang.Nullable; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +@Controller +@RequestMapping("${openapi.byteFormatEdgeCases.base-path:}") +public class MultipartApiController implements MultipartApi { + + private final NativeWebRequest request; + + @Autowired + public MultipartApiController(NativeWebRequest request) { + this.request = request; + } + + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + +} diff --git a/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/PathApi.java b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/PathApi.java new file mode 100644 index 000000000000..d0ef52b999fb --- /dev/null +++ b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/PathApi.java @@ -0,0 +1,71 @@ +/* + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.20.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import io.swagger.v3.oas.annotations.ExternalDocumentation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +@Validated +@Tag(name = "path", description = "the path API") +public interface PathApi { + + default Optional getRequest() { + return Optional.empty(); + } + + String PATH_PATH_PARAMS = "/path/{plain}/{bytes}"; + /** + * GET /path/{plain}/{bytes} : Path parameters + * + * @param plain (required) + * @param bytes (required) + * @return No content (status code 204) + */ + @Operation( + operationId = "pathParams", + summary = "Path parameters", + responses = { + @ApiResponse(responseCode = "204", description = "No content") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = PathApi.PATH_PATH_PARAMS + ) + default ResponseEntity pathParams( + @NotNull @Parameter(name = "plain", description = "", required = true, in = ParameterIn.PATH) @PathVariable("plain") String plain, + @NotNull @Parameter(name = "bytes", description = "", required = true, in = ParameterIn.PATH) @PathVariable("bytes") String bytes /* base64 encoded binary */ + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/PathApiController.java b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/PathApiController.java new file mode 100644 index 000000000000..79cb69cd10e1 --- /dev/null +++ b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/PathApiController.java @@ -0,0 +1,45 @@ +package org.openapitools.api; + + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +@Controller +@RequestMapping("${openapi.byteFormatEdgeCases.base-path:}") +public class PathApiController implements PathApi { + + private final NativeWebRequest request; + + @Autowired + public PathApiController(NativeWebRequest request) { + this.request = request; + } + + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + +} diff --git a/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/QueryApi.java b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/QueryApi.java new file mode 100644 index 000000000000..10d8c19779ac --- /dev/null +++ b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/QueryApi.java @@ -0,0 +1,72 @@ +/* + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (7.20.0-SNAPSHOT). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +package org.openapitools.api; + +import org.springframework.lang.Nullable; +import io.swagger.v3.oas.annotations.ExternalDocumentation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.Parameters; +import io.swagger.v3.oas.annotations.media.ArraySchema; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.enums.ParameterIn; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.context.request.NativeWebRequest; +import org.springframework.web.multipart.MultipartFile; + +import javax.validation.Valid; +import javax.validation.constraints.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +@Validated +@Tag(name = "query", description = "the query API") +public interface QueryApi { + + default Optional getRequest() { + return Optional.empty(); + } + + String PATH_QUERY_PARAMS = "/query"; + /** + * GET /query : Query parameters + * + * @param plain (optional) + * @param bytes (optional) + * @return No content (status code 204) + */ + @Operation( + operationId = "queryParams", + summary = "Query parameters", + responses = { + @ApiResponse(responseCode = "204", description = "No content") + } + ) + @RequestMapping( + method = RequestMethod.GET, + value = QueryApi.PATH_QUERY_PARAMS + ) + default ResponseEntity queryParams( + @Parameter(name = "plain", description = "", in = ParameterIn.QUERY) @Valid @RequestParam(value = "plain", required = false) @Nullable String plain, + @Parameter(name = "bytes", description = "", in = ParameterIn.QUERY) @Valid @RequestParam(value = "bytes", required = false) @Nullable String bytes /* base64 encoded binary */ + ) { + return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); + + } + +} diff --git a/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/QueryApiController.java b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/QueryApiController.java new file mode 100644 index 000000000000..12a46e2f67e0 --- /dev/null +++ b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/api/QueryApiController.java @@ -0,0 +1,46 @@ +package org.openapitools.api; + +import org.springframework.lang.Nullable; + + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestHeader; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.CookieValue; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RequestPart; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.context.request.NativeWebRequest; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import java.util.List; +import java.util.Map; +import java.util.Optional; +import javax.annotation.Generated; + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +@Controller +@RequestMapping("${openapi.byteFormatEdgeCases.base-path:}") +public class QueryApiController implements QueryApi { + + private final NativeWebRequest request; + + @Autowired + public QueryApiController(NativeWebRequest request) { + this.request = request; + } + + @Override + public Optional getRequest() { + return Optional.ofNullable(request); + } + +} diff --git a/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/configuration/HomeController.java new file mode 100644 index 000000000000..9aa29284ab5f --- /dev/null +++ b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/configuration/HomeController.java @@ -0,0 +1,20 @@ +package org.openapitools.configuration; + +import org.springframework.context.annotation.Bean; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.GetMapping; + +/** + * Home redirection to OpenAPI api documentation + */ +@Controller +public class HomeController { + + @RequestMapping("/") + public String index() { + return "redirect:swagger-ui.html"; + } + +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java new file mode 100644 index 000000000000..4262ec5c96a3 --- /dev/null +++ b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java @@ -0,0 +1,27 @@ +package org.openapitools.configuration; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.Contact; +import io.swagger.v3.oas.models.info.License; +import io.swagger.v3.oas.models.Components; +import io.swagger.v3.oas.models.security.SecurityScheme; + +@Configuration +public class SpringDocConfiguration { + + @Bean(name = "org.openapitools.configuration.SpringDocConfiguration.apiInfo") + OpenAPI apiInfo() { + return new OpenAPI() + .info( + new Info() + .title("Byte Format Edge Cases") + .description("No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)") + .version("1.0.0") + ) + ; + } +} \ No newline at end of file diff --git a/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/model/FormParamsRequest.java b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/model/FormParamsRequest.java new file mode 100644 index 000000000000..45a6712a7e0f --- /dev/null +++ b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/java/org/openapitools/model/FormParamsRequest.java @@ -0,0 +1,111 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Arrays; +import org.springframework.lang.Nullable; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * FormParamsRequest + */ + +@JsonTypeName("formParams_request") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.20.0-SNAPSHOT") +public class FormParamsRequest { + + private @Nullable String plain; + + private @Nullable byte[] bytes; + + public FormParamsRequest plain(@Nullable String plain) { + this.plain = plain; + return this; + } + + /** + * Get plain + * @return plain + */ + + @Schema(name = "plain", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("plain") + public @Nullable String getPlain() { + return plain; + } + + public void setPlain(@Nullable String plain) { + this.plain = plain; + } + + public FormParamsRequest bytes(@Nullable byte[] bytes) { + this.bytes = bytes; + return this; + } + + /** + * Get bytes + * @return bytes + */ + + @Schema(name = "bytes", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + @JsonProperty("bytes") + public @Nullable byte[] getBytes() { + return bytes; + } + + public void setBytes(@Nullable byte[] bytes) { + this.bytes = bytes; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FormParamsRequest formParamsRequest = (FormParamsRequest) o; + return Objects.equals(this.plain, formParamsRequest.plain) && + Arrays.equals(this.bytes, formParamsRequest.bytes); + } + + @Override + public int hashCode() { + return Objects.hash(plain, Arrays.hashCode(bytes)); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FormParamsRequest {\n"); + sb.append(" plain: ").append(toIndentedString(plain)).append("\n"); + sb.append(" bytes: ").append(toIndentedString(bytes)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(@Nullable Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-byte-format-edge-cases/src/main/resources/application.properties b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/resources/application.properties new file mode 100644 index 000000000000..7e90813e59b2 --- /dev/null +++ b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/resources/application.properties @@ -0,0 +1,3 @@ +server.port=8080 +spring.jackson.date-format=org.openapitools.RFC3339DateFormat +spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false diff --git a/samples/server/petstore/springboot-byte-format-edge-cases/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/resources/openapi.yaml new file mode 100644 index 000000000000..70d0f20340b3 --- /dev/null +++ b/samples/server/petstore/springboot-byte-format-edge-cases/src/main/resources/openapi.yaml @@ -0,0 +1,193 @@ +openapi: 3.0.3 +info: + title: Byte Format Edge Cases + version: 1.0.0 +servers: +- url: / +paths: + /query: + get: + operationId: queryParams + parameters: + - explode: true + in: query + name: plain + required: false + schema: + type: string + style: form + - explode: true + in: query + name: bytes + required: false + schema: + format: byte + type: string + style: form + responses: + "204": + description: No content + summary: Query parameters + x-accepts: + - application/json + /path/{plain}/{bytes}: + get: + operationId: pathParams + parameters: + - explode: false + in: path + name: plain + required: true + schema: + type: string + style: simple + - explode: false + in: path + name: bytes + required: true + schema: + format: byte + type: string + style: simple + responses: + "204": + description: No content + summary: Path parameters + x-accepts: + - application/json + /header: + get: + operationId: headerParams + parameters: + - explode: false + in: header + name: X-Plain + required: false + schema: + type: string + style: simple + - explode: false + in: header + name: X-Byte + required: false + schema: + format: byte + type: string + style: simple + responses: + "204": + description: No content + summary: Header parameters + x-accepts: + - application/json + /cookie: + get: + operationId: cookieParams + parameters: + - explode: true + in: cookie + name: plain + required: false + schema: + type: string + style: form + - explode: true + in: cookie + name: bytes + required: false + schema: + format: byte + type: string + style: form + responses: + "204": + description: No content + summary: Cookie parameters + x-accepts: + - application/json + /form: + post: + operationId: formParams + requestBody: + content: + application/x-www-form-urlencoded: + schema: + $ref: "#/components/schemas/formParams_request" + required: true + responses: + "204": + description: No content + summary: application/x-www-form-urlencoded + x-content-type: application/x-www-form-urlencoded + x-accepts: + - application/json + /multipart: + post: + operationId: multipartParams + requestBody: + content: + multipart/form-data: + schema: + $ref: "#/components/schemas/multipartParams_request" + required: true + responses: + "204": + description: No content + summary: multipart/form-data + x-content-type: multipart/form-data + x-accepts: + - application/json + /json-body: + post: + operationId: jsonBody + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/formParams_request" + required: true + responses: + "204": + description: No content + summary: JSON request body + x-content-type: application/json + x-accepts: + - application/json + /binary-body: + post: + operationId: binaryBody + requestBody: + content: + application/octet-stream: + schema: + format: binary + type: string + required: true + responses: + "204": + description: No content + summary: Raw binary body + x-content-type: application/octet-stream + x-accepts: + - application/json +components: + schemas: + multipartParams_request: + properties: + plain: + type: string + bytes: + format: byte + type: string + file: + format: binary + type: string + type: object + formParams_request: + properties: + plain: + type: string + bytes: + format: byte + type: string + type: object diff --git a/samples/server/petstore/springboot-byte-format-edge-cases/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/server/petstore/springboot-byte-format-edge-cases/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java new file mode 100644 index 000000000000..3681f67e7705 --- /dev/null +++ b/samples/server/petstore/springboot-byte-format-edge-cases/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java @@ -0,0 +1,13 @@ +package org.openapitools; + +import org.junit.jupiter.api.Test; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +class OpenApiGeneratorApplicationTests { + + @Test + void contextLoads() { + } + +} \ No newline at end of file From 6e37d4eb470cb817790494575a0d25d676f63c8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1chym=20Metli=C4=8Dka?= Date: Tue, 10 Feb 2026 09:27:04 +0100 Subject: [PATCH 6/7] add sample and fix log --- .github/workflows/samples-spring.yaml | 1 + bin/configs/spring-boot-byte-format-edge-cases.yaml | 8 ++++++++ .../org/openapitools/codegen/languages/SpringCodegen.java | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 bin/configs/spring-boot-byte-format-edge-cases.yaml diff --git a/.github/workflows/samples-spring.yaml b/.github/workflows/samples-spring.yaml index 7f0a903ace3d..1af84356149e 100644 --- a/.github/workflows/samples-spring.yaml +++ b/.github/workflows/samples-spring.yaml @@ -44,6 +44,7 @@ jobs: - samples/server/petstore/spring-boot-nullable-set - samples/server/petstore/spring-boot-defaultInterface-unhandledExcp - samples/server/petstore/springboot + - samples/server/petstore/springboot-byte-format-edge-cases - samples/server/petstore/springboot-beanvalidation - samples/server/petstore/springboot-builtin-validation - samples/server/petstore/springboot-delegate diff --git a/bin/configs/spring-boot-byte-format-edge-cases.yaml b/bin/configs/spring-boot-byte-format-edge-cases.yaml new file mode 100644 index 000000000000..21bbbc44b39c --- /dev/null +++ b/bin/configs/spring-boot-byte-format-edge-cases.yaml @@ -0,0 +1,8 @@ +generatorName: spring +outputDir: samples/server/petstore/springboot-byte-format-edge-cases +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/byte-format-edge-cases.yaml +templateDir: modules/openapi-generator/src/main/resources/JavaSpring +additionalProperties: + artifactId: springboot + snapshotVersion: "true" + hideGenerationTimestamp: "true" diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java index 90160d2dc5eb..ace31fc723cf 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java @@ -831,7 +831,7 @@ private void convertByteArrayParamsToStringType(CodegenOperation operation) { .filter(param -> param.isQueryParam || param.isPathParam || param.isHeaderParam || param.isCookieParam || param.isFormParam) .peek(param -> param.dataType = "String") .collect(Collectors.toList()); - LOGGER.info("Converted parameters {} from byte[] to String in operation {}", convertedParams.stream().map(param -> param.paramName), operation.operationId); + LOGGER.info("Converted parameters [{}] from byte[] to String in operation [{}]", convertedParams.stream().map(param -> param.paramName).collect(Collectors.toList()), operation.operationId); } private interface DataTypeAssigner { From e0d2d566db4b869cca38ad11784d602a5b8ee7cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1chym=20Metli=C4=8Dka?= Date: Tue, 10 Feb 2026 09:41:43 +0100 Subject: [PATCH 7/7] up-to-date --- .../.openapi-generator/FILES | 9 --------- 1 file changed, 9 deletions(-) diff --git a/samples/server/petstore/springboot-byte-format-edge-cases/.openapi-generator/FILES b/samples/server/petstore/springboot-byte-format-edge-cases/.openapi-generator/FILES index 6901defe40b3..4659ab4c61b2 100644 --- a/samples/server/petstore/springboot-byte-format-edge-cases/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-byte-format-edge-cases/.openapi-generator/FILES @@ -1,25 +1,16 @@ -.openapi-generator-ignore README.md pom.xml src/main/java/org/openapitools/OpenApiGeneratorApplication.java src/main/java/org/openapitools/RFC3339DateFormat.java src/main/java/org/openapitools/api/ApiUtil.java src/main/java/org/openapitools/api/BinaryBodyApi.java -src/main/java/org/openapitools/api/BinaryBodyApiController.java src/main/java/org/openapitools/api/CookieApi.java -src/main/java/org/openapitools/api/CookieApiController.java src/main/java/org/openapitools/api/FormApi.java -src/main/java/org/openapitools/api/FormApiController.java src/main/java/org/openapitools/api/HeaderApi.java -src/main/java/org/openapitools/api/HeaderApiController.java src/main/java/org/openapitools/api/JsonBodyApi.java -src/main/java/org/openapitools/api/JsonBodyApiController.java src/main/java/org/openapitools/api/MultipartApi.java -src/main/java/org/openapitools/api/MultipartApiController.java src/main/java/org/openapitools/api/PathApi.java -src/main/java/org/openapitools/api/PathApiController.java src/main/java/org/openapitools/api/QueryApi.java -src/main/java/org/openapitools/api/QueryApiController.java src/main/java/org/openapitools/configuration/HomeController.java src/main/java/org/openapitools/configuration/SpringDocConfiguration.java src/main/java/org/openapitools/model/FormParamsRequest.java