From 65d3b602445ced37c76ccb01327a65e1f36be12d Mon Sep 17 00:00:00 2001 From: Chris Gual Date: Mon, 14 Jul 2025 15:28:45 -0700 Subject: [PATCH 1/2] Use Flux only for multipart-form-data file parameters with multiple files --- .../main/resources/JavaSpring/api.mustache | 2 +- .../resources/JavaSpring/apiDelegate.mustache | 2 +- .../resources/JavaSpring/formParams.mustache | 2 +- .../java/spring/SpringCodegenTest.java | 60 +++++++++++++++++++ 4 files changed, 63 insertions(+), 3 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache index 053cecf38559..b1a8c61f967a 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache @@ -275,7 +275,7 @@ public interface {{classname}} { } // Override this method - {{#jdk8-default-interface}}default {{/jdk8-default-interface}} {{>responseType}} {{operationId}}({{#allParams}}{{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{>optionalDataType}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}}{{/isFile}}{{#isFile}}{{#reactive}}Flux{{/reactive}}{{^reactive}}{{#isArray}}List{{/isArray}}{{^isArray}}MultipartFile{{/isArray}}{{/reactive}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}{{#springFoxDocumentationProvider}}@ApiIgnore{{/springFoxDocumentationProvider}} final ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}{{#hasParams}}, {{/hasParams}}{{^hasParams}}{{#reactive}}, {{/reactive}}{{/hasParams}}{{#springFoxDocumentationProvider}}@ApiIgnore{{/springFoxDocumentationProvider}}final Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{#unhandledException}} throws Exception{{/unhandledException}} { + {{#jdk8-default-interface}}default {{/jdk8-default-interface}} {{>responseType}} {{operationId}}({{#allParams}}{{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{>optionalDataType}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}}{{/isFile}}{{#isFile}}{{#reactive}}{{#isArray}}Flux<{{/isArray}}Part{{#isArray}}>{{/isArray}}{{/reactive}}{{^reactive}}{{#isArray}}List<{{/isArray}}MultipartFile{{#isArray}}>{{/isArray}}{{/reactive}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}{{#springFoxDocumentationProvider}}@ApiIgnore{{/springFoxDocumentationProvider}} final ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}{{#hasParams}}, {{/hasParams}}{{^hasParams}}{{#reactive}}, {{/reactive}}{{/hasParams}}{{#springFoxDocumentationProvider}}@ApiIgnore{{/springFoxDocumentationProvider}}final Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{#unhandledException}} throws Exception{{/unhandledException}} { {{/delegate-method}} {{^isDelegate}} {{>methodBody}}{{! prevent indent}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/apiDelegate.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/apiDelegate.mustache index a14a42a8d0b7..9c5605645b7d 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/apiDelegate.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/apiDelegate.mustache @@ -68,7 +68,7 @@ public interface {{classname}}Delegate { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - {{#jdk8-default-interface}}default {{/jdk8-default-interface}}{{>responseType}} {{operationId}}({{#allParams}}{{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{>optionalDataType}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}}{{/isFile}}{{#isFile}}{{#isArray}}List<{{/isArray}}{{#reactive}}Flux{{/reactive}}{{^reactive}}{{#isFormParam}}MultipartFile{{/isFormParam}}{{^isFormParam}}{{>optionalDataType}}{{/isFormParam}}{{/reactive}}{{#isArray}}>{{/isArray}}{{/isFile}} {{paramName}}{{^-last}}, + {{#jdk8-default-interface}}default {{/jdk8-default-interface}}{{>responseType}} {{operationId}}({{#allParams}}{{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{>optionalDataType}}{{/reactive}}{{#reactive}}{{^isArray}}Mono<{{{dataType}}}>{{/isArray}}{{#isArray}}Flux<{{{baseType}}}>{{/isArray}}{{/reactive}}{{/isBodyParam}}{{/isFile}}{{#isFile}}{{#reactive}}{{#isArray}}Flux<{{/isArray}}Part{{#isArray}}>{{/isArray}}{{/reactive}}{{^reactive}}{{#isArray}}List<{{/isArray}}{{#isFormParam}}MultipartFile{{/isFormParam}}{{^isFormParam}}{{>optionalDataType}}{{/isFormParam}}{{#isArray}}>{{/isArray}}{{/reactive}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}{{#hasParams}}, {{/hasParams}}{{^hasParams}}{{#reactive}}, {{/reactive}}{{/hasParams}}final Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{#unhandledException}} throws Exception{{/unhandledException}}{{^jdk8-default-interface}};{{/jdk8-default-interface}}{{#jdk8-default-interface}} { {{>methodBody}}{{! prevent indent}} diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/formParams.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/formParams.mustache index fdb51cc6c69c..08b8b2b3c746 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}} @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}}) {{#isArray}}List<{{/isArray}}{{#reactive}}Flux{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{#isArray}}>{{/isArray}} {{paramName}}{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{^isFile}}{{>paramDoc}}{{#useBeanValidation}} @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 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 54b0e81ac9d1..cbeed0ea3818 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 @@ -733,6 +733,66 @@ public void testMultipartBoot() throws IOException { .containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"statusArray\"", "required", "false")); } + @Test + public void testReactiveMultipartBoot() throws IOException { + final SpringCodegen codegen = new SpringCodegen(); + codegen.setLibrary("spring-boot"); + codegen.setDelegatePattern(true); + codegen.additionalProperties().put(DOCUMENTATION_PROVIDER, "springfox"); + codegen.additionalProperties().put(SpringCodegen.REACTIVE, "true"); + + final Map files = generateFiles(codegen, "src/test/resources/3_0/form-multipart-binary-array.yaml"); + + // Check that the delegate handles the array + JavaFileAssert.assertThat(files.get("MultipartArrayApiDelegate.java")) + .assertMethod("multipartArray", "Flux", "ServerWebExchange") + .assertParameter("files").hasType("Flux"); + + // Check that the api handles the array + JavaFileAssert.assertThat(files.get("MultipartArrayApi.java")) + .assertMethod("multipartArray", "Flux", "ServerWebExchange") + .assertParameter("files").hasType("Flux") + .assertParameterAnnotations() + .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("value", "\"Many files\"")) + .containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"files\"", "required", "false")); + + // UPDATE: the following test has been ignored due to https://github.com/OpenAPITools/openapi-generator/pull/11081/ + // We will contact the contributor of the following test to see if the fix will break their use cases and + // how we can fix it accordingly. + //// Check that the delegate handles the single file + // final File multipartSingleApiDelegate = files.get("MultipartSingleApiDelegate.java"); + // assertFileContains(multipartSingleApiDelegate.toPath(), "MultipartFile file"); + + // Check that the api handles the single file + JavaFileAssert.assertThat(files.get("MultipartSingleApi.java")) + .assertMethod("multipartSingle", "Part", "ServerWebExchange") + .assertParameter("file").hasType("Part") + .assertParameterAnnotations() + .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("value", "\"One file\"")) + .containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"file\"", "required", "false")); + + // Check that api validates mixed multipart request + JavaFileAssert.assertThat(files.get("MultipartMixedApi.java")) + .assertMethod("multipartMixed", "MultipartMixedStatus", "Part", "MultipartMixedRequestMarker", "List", "ServerWebExchange") + .assertParameter("status").hasType("MultipartMixedStatus") + .assertParameterAnnotations() + .containsWithName("Valid") + .containsWithNameAndAttributes("ApiParam", ImmutableMap.of("value", "\"\"")) + .containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"status\"", "required", "true")) + .toParameter().toMethod() + .assertParameter("file").hasType("Part") + .assertParameterAnnotations() + .containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"file\"", "required", "true")) + .toParameter().toMethod() + .assertParameter("marker").hasType("MultipartMixedRequestMarker") + .assertParameterAnnotations() + .containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"marker\"", "required", "false")) + .toParameter().toMethod() + .assertParameter("statusArray").hasType("List") + .assertParameterAnnotations() + .containsWithNameAndAttributes("RequestPart", ImmutableMap.of("value", "\"statusArray\"", "required", "false")); + } + @Test public void testAdditionalProperties_issue1466() throws IOException { final SpringCodegen codegen = new SpringCodegen(); From 9917e36653dd80a3a6347469a3ecb49c1ab5535c Mon Sep 17 00:00:00 2001 From: Chris Gual Date: Mon, 14 Jul 2025 20:03:37 -0700 Subject: [PATCH 2/2] Update samples --- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 4 ++-- .../src/main/java/org/openapitools/api/FakeApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApi.java | 4 ++-- .../src/main/java/org/openapitools/api/FakeApi.java | 4 ++-- .../src/main/java/org/openapitools/api/FakeApiDelegate.java | 4 ++-- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApiDelegate.java | 2 +- .../src/main/java/org/openapitools/api/FakeApi.java | 4 ++-- .../src/main/java/org/openapitools/api/FakeApiDelegate.java | 4 ++-- .../src/main/java/org/openapitools/api/PetApi.java | 2 +- .../src/main/java/org/openapitools/api/PetApiDelegate.java | 2 +- 12 files changed, 18 insertions(+), 18 deletions(-) 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 8bf9efcf1bfa..a59351be0e3c 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 @@ -226,7 +226,7 @@ Mono testEndpointParameters( @RequestPart(value = "int64", required = false) Long int64, @RequestPart(value = "float", required = false) Float _float, @RequestPart(value = "string", required = false) String string, - @RequestPart(value = "binary", required = false) Flux binary, + @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, 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 4979d5a256e8..8a41fe3ae5fe 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 @@ -210,7 +210,7 @@ Mono updatePetWithForm( Mono uploadFile( @PathVariable("petId") Long petId, @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @RequestPart(value = "file", required = false) Flux file + @RequestPart(value = "file", required = false) Part file ); @@ -232,7 +232,7 @@ Mono uploadFile( ) Mono uploadFileWithRequiredFile( @PathVariable("petId") Long petId, - @RequestPart(value = "requiredFile", required = true) Flux requiredFile, + @RequestPart(value = "requiredFile", required = true) Part requiredFile, @RequestPart(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 d9004413b7fe..4c61d89dc135 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 @@ -217,7 +217,7 @@ Mono> testEndpointParameters( @RequestPart(value = "int64", required = false) Long int64, @RequestPart(value = "float", required = false) Float _float, @RequestPart(value = "string", required = false) String string, - @RequestPart(value = "binary", required = false) Flux binary, + @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, 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 7da62c73f752..6894a75245fb 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 @@ -201,7 +201,7 @@ Mono> updatePetWithForm( Mono> uploadFile( @PathVariable("petId") Long petId, @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, - @RequestPart(value = "file", required = false) Flux file + @RequestPart(value = "file", required = false) Part file ); @@ -222,7 +222,7 @@ Mono> uploadFile( ) Mono> uploadFileWithRequiredFile( @PathVariable("petId") Long petId, - @RequestPart(value = "requiredFile", required = true) Flux requiredFile, + @RequestPart(value = "requiredFile", required = true) Part requiredFile, @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata ); 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 60d0de615814..c6bc78d5dc24 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 @@ -396,7 +396,7 @@ default Mono testEndpointParameters( @ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, - @ApiParam(value = "None") @RequestPart(value = "binary", required = false) Flux binary, + @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") @Valid @RequestPart(value = "password", required = false) String password, @@ -698,7 +698,7 @@ default Mono testWithResultExample( default Mono uploadFileWithRequiredFile( @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) Flux requiredFile, + @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, @ApiIgnore final ServerWebExchange exchange ) { 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 4d9e5d40c13f..f9adf53ee211 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 @@ -238,7 +238,7 @@ default Mono testEndpointParameters(BigDecimal number, Long int64, Float _float, String string, - Flux binary, + Part binary, LocalDate date, OffsetDateTime dateTime, String password, @@ -411,7 +411,7 @@ default Mono testWithResultExample(ServerWebExchange exchange) { * @see FakeApi#uploadFileWithRequiredFile */ default Mono uploadFileWithRequiredFile(Long petId, - Flux requiredFile, + Part requiredFile, String additionalMetadata, ServerWebExchange exchange) { Mono result = Mono.empty(); 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 3475b09b8c09..978be22f6121 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 @@ -365,7 +365,7 @@ default Mono updatePetWithForm( default Mono uploadFile( @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 = "file to upload") @RequestPart(value = "file", required = false) Flux file, + @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) Part file, @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().uploadFile(petId, additionalMetadata, file, exchange); diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/PetApiDelegate.java index 9f666ec7414c..fcee0e1dbdec 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -209,7 +209,7 @@ default Mono updatePetWithForm(Long petId, */ default Mono uploadFile(Long petId, String additionalMetadata, - Flux file, + Part file, ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); 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 095446b714b9..b9f4e3a1d909 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 @@ -386,7 +386,7 @@ default Mono> testEndpointParameters( @ApiParam(value = "None") @Valid @RequestPart(value = "int64", required = false) Long int64, @ApiParam(value = "None") @Valid @RequestPart(value = "float", required = false) Float _float, @ApiParam(value = "None") @Valid @RequestPart(value = "string", required = false) String string, - @ApiParam(value = "None") @RequestPart(value = "binary", required = false) Flux binary, + @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") @Valid @RequestPart(value = "password", required = false) String password, @@ -680,7 +680,7 @@ default Mono> testWithResultExample( default Mono> uploadFileWithRequiredFile( @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) Flux requiredFile, + @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, @ApiIgnore final ServerWebExchange exchange ) { 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 753459a1917a..9762c352268b 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 @@ -239,7 +239,7 @@ default Mono> testEndpointParameters(BigDecimal number, Long int64, Float _float, String string, - Flux binary, + Part binary, LocalDate date, OffsetDateTime dateTime, String password, @@ -412,7 +412,7 @@ default Mono> testWithResultExample(ServerWebExchange ex * @see FakeApi#uploadFileWithRequiredFile */ default Mono> uploadFileWithRequiredFile(Long petId, - Flux requiredFile, + Part requiredFile, String additionalMetadata, ServerWebExchange exchange) { Mono result = Mono.empty(); 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 9889c3617021..926feb47d232 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 @@ -357,7 +357,7 @@ default Mono> updatePetWithForm( default Mono> uploadFile( @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 = "file to upload") @RequestPart(value = "file", required = false) Flux file, + @ApiParam(value = "file to upload") @RequestPart(value = "file", required = false) Part file, @ApiIgnore final ServerWebExchange exchange ) { return getDelegate().uploadFile(petId, additionalMetadata, file, exchange); diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java index 68c88a6a26c5..09a24b0a6e18 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -210,7 +210,7 @@ default Mono> updatePetWithForm(Long petId, */ default Mono> uploadFile(Long petId, String additionalMetadata, - Flux file, + Part file, ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED);