From b9a1c8f016711307b9c718dbbdf60a137372c7af Mon Sep 17 00:00:00 2001 From: Mateusz Hubert Stefaniak Date: Mon, 26 Apr 2021 03:49:21 +0200 Subject: [PATCH] [Java][Spring] Fix for #8659 - Different in-parameter types generated for api and delegate for files (#9331) --- .../codegen/languages/SpringCodegen.java | 4 ++-- .../Java/libraries/resttemplate/api.mustache | 4 ++-- .../Java/libraries/resttemplate/api_test.mustache | 2 +- .../resources/JavaSpring/homeController.mustache | 2 +- .../codegen/java/JavaClientCodegenTest.java | 12 ++++++------ .../main/java/org/openapitools/model/FormatTest.java | 8 ++++---- .../main/java/org/openapitools/model/FormatTest.java | 8 ++++---- .../main/java/org/openapitools/model/FormatTest.java | 8 ++++---- .../main/java/org/openapitools/model/FormatTest.java | 8 ++++---- .../main/java/org/openapitools/model/FormatTest.java | 8 ++++---- .../main/java/org/openapitools/model/FormatTest.java | 8 ++++---- .../main/java/org/openapitools/model/FormatTest.java | 8 ++++---- .../main/java/org/openapitools/model/FormatTest.java | 8 ++++---- .../main/java/org/openapitools/model/FormatTest.java | 8 ++++---- .../main/java/org/openapitools/model/FormatTest.java | 8 ++++---- .../openapitools/configuration/HomeController.java | 2 +- .../main/java/org/openapitools/model/FormatTest.java | 8 ++++---- .../main/java/org/openapitools/model/FormatTest.java | 8 ++++---- .../main/java/org/openapitools/model/FormatTest.java | 8 ++++---- .../main/java/org/openapitools/model/FormatTest.java | 8 ++++---- .../main/java/org/openapitools/model/FormatTest.java | 8 ++++---- .../main/java/org/openapitools/model/FormatTest.java | 8 ++++---- .../org/openapitools/virtualan/model/FormatTest.java | 8 ++++---- .../main/java/org/openapitools/model/FormatTest.java | 8 ++++---- 24 files changed, 85 insertions(+), 85 deletions(-) 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 058acbed956a..4c4f0e19496c 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 @@ -336,8 +336,8 @@ public void processOpts() { } additionalProperties.put(UNHANDLED_EXCEPTION_HANDLING, this.isUnhandledException()); - typeMapping.put("file", "org.springframework.core.io.Resource"); - importMapping.put("org.springframework.core.io.Resource", "org.springframework.core.io.Resource"); + typeMapping.put("file", "org.springframework.web.multipart.MultipartFile"); + importMapping.put("org.springframework.web.multipart.MultipartFile", "org.springframework.web.multipart.MultipartFile"); if (useOptional) { writePropertyBack(USE_OPTIONAL, useOptional); diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache index 006e6cf8f931..dce5d6472677 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api.mustache @@ -71,7 +71,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.Resource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientException { + public {{#returnType}}{{{returnType}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.web.multipart.MultipartFile{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientException { {{#returnType}} return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}).getBody(); {{/returnType}} @@ -99,7 +99,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public ResponseEntity<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.Resource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientException { + public ResponseEntity<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.web.multipart.MultipartFile{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws RestClientException { Object postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}}{{#required}} // verify the required parameter '{{paramName}}' is set diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api_test.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api_test.mustache index 119194543c37..56d89a842d44 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api_test.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/api_test.mustache @@ -34,7 +34,7 @@ public class {{classname}}Test { @Test public void {{operationId}}Test() { {{#allParams}} - {{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.core.io.Resource{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}} = null; + {{#isFile}}{{#useAbstractionForFiles}}{{#collectionFormat}}java.util.Collection{{/collectionFormat}}{{^collectionFormat}}org.springframework.web.multipart.MultipartFile{{/collectionFormat}}{{/useAbstractionForFiles}}{{^useAbstractionForFiles}}{{{dataType}}}{{/useAbstractionForFiles}}{{/isFile}}{{^isFile}}{{{dataType}}}{{/isFile}} {{paramName}} = null; {{/allParams}} {{#returnType}}{{{returnType}}} response = {{/returnType}}api.{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/homeController.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/homeController.mustache index f909a15b37df..2b244c540bc4 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/homeController.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/homeController.mustache @@ -4,7 +4,7 @@ package {{configPackage}}; import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; -import org.springframework.core.io.Resource; +import org.springframework.web.multipart.MultipartFile; {{/useSpringfox}} import org.springframework.stereotype.Controller; {{^useSpringfox}} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java index 3ead6f31f9e0..3a7636d631c5 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java @@ -1028,18 +1028,18 @@ public void testRestTemplateWithUseAbstractionForFiles() throws IOException { Path defaultApi = Paths.get(output + "/src/main/java/xyz/abcdef/api/MultipartApi.java"); TestUtils.assertFileContains(defaultApi, //multiple files - "multipartArray(java.util.Collection files)", - "multipartArrayWithHttpInfo(java.util.Collection files)", + "multipartArray(java.util.Collection files)", + "multipartArrayWithHttpInfo(java.util.Collection files)", "formParams.addAll(\"files\", files.stream().collect(Collectors.toList()));", //mixed - "multipartMixed(org.springframework.core.io.Resource file, MultipartMixedMarker marker)", - "multipartMixedWithHttpInfo(org.springframework.core.io.Resource file, MultipartMixedMarker marker)", + "multipartMixed(org.springframework.web.multipart.MultipartFile file, MultipartMixedMarker marker)", + "multipartMixedWithHttpInfo(org.springframework.web.multipart.MultipartFile file, MultipartMixedMarker marker)", "formParams.add(\"file\", file);", //single file - "multipartSingle(org.springframework.core.io.Resource file)", - "multipartSingleWithHttpInfo(org.springframework.core.io.Resource file)", + "multipartSingle(org.springframework.web.multipart.MultipartFile file)", + "multipartSingleWithHttpInfo(org.springframework.web.multipart.MultipartFile file)", "formParams.add(\"file\", file);" ); } diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FormatTest.java index e894f561fc6e..72f64c2b3704 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/org/openapitools/model/FormatTest.java @@ -44,7 +44,7 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private org.springframework.web.multipart.MultipartFile binary; @JsonProperty("date") @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) @@ -236,7 +236,7 @@ public void setByte(byte[] _byte) { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(org.springframework.web.multipart.MultipartFile binary) { this.binary = binary; return this; } @@ -249,11 +249,11 @@ public FormatTest binary(org.springframework.core.io.Resource binary) { @Valid - public org.springframework.core.io.Resource getBinary() { + public org.springframework.web.multipart.MultipartFile getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(org.springframework.web.multipart.MultipartFile binary) { this.binary = binary; } diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FormatTest.java index 04e164b1c521..9efca6d654bc 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/org/openapitools/model/FormatTest.java @@ -44,7 +44,7 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private org.springframework.web.multipart.MultipartFile binary; @JsonProperty("date") @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) @@ -236,7 +236,7 @@ public void setByte(byte[] _byte) { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(org.springframework.web.multipart.MultipartFile binary) { this.binary = binary; return this; } @@ -249,11 +249,11 @@ public FormatTest binary(org.springframework.core.io.Resource binary) { @Valid - public org.springframework.core.io.Resource getBinary() { + public org.springframework.web.multipart.MultipartFile getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(org.springframework.web.multipart.MultipartFile binary) { this.binary = binary; } diff --git a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/FormatTest.java index 0962957d79fc..06978db9b9ea 100644 --- a/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/spring-mvc-no-nullable/src/main/java/org/openapitools/model/FormatTest.java @@ -43,7 +43,7 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private org.springframework.web.multipart.MultipartFile binary; @JsonProperty("date") @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) @@ -235,7 +235,7 @@ public void setByte(byte[] _byte) { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(org.springframework.web.multipart.MultipartFile binary) { this.binary = binary; return this; } @@ -248,11 +248,11 @@ public FormatTest binary(org.springframework.core.io.Resource binary) { @Valid - public org.springframework.core.io.Resource getBinary() { + public org.springframework.web.multipart.MultipartFile getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(org.springframework.web.multipart.MultipartFile binary) { this.binary = binary; } diff --git a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java index e894f561fc6e..72f64c2b3704 100644 --- a/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/spring-mvc-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java @@ -44,7 +44,7 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private org.springframework.web.multipart.MultipartFile binary; @JsonProperty("date") @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) @@ -236,7 +236,7 @@ public void setByte(byte[] _byte) { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(org.springframework.web.multipart.MultipartFile binary) { this.binary = binary; return this; } @@ -249,11 +249,11 @@ public FormatTest binary(org.springframework.core.io.Resource binary) { @Valid - public org.springframework.core.io.Resource getBinary() { + public org.springframework.web.multipart.MultipartFile getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(org.springframework.web.multipart.MultipartFile binary) { this.binary = binary; } diff --git a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FormatTest.java index 80ea59cef112..2a1722c3190b 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/spring-mvc/src/main/java/org/openapitools/model/FormatTest.java @@ -46,7 +46,7 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private org.springframework.web.multipart.MultipartFile binary; @JsonProperty("date") @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) @@ -238,7 +238,7 @@ public void setByte(byte[] _byte) { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(org.springframework.web.multipart.MultipartFile binary) { this.binary = binary; return this; } @@ -251,11 +251,11 @@ public FormatTest binary(org.springframework.core.io.Resource binary) { @Valid - public org.springframework.core.io.Resource getBinary() { + public org.springframework.web.multipart.MultipartFile getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(org.springframework.web.multipart.MultipartFile binary) { this.binary = binary; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java index 60247deff4c6..99f755655a9d 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java @@ -43,7 +43,7 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private org.springframework.web.multipart.MultipartFile binary; @JsonProperty("date") @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) @@ -235,7 +235,7 @@ public void setByte(byte[] _byte) { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(org.springframework.web.multipart.MultipartFile binary) { this.binary = binary; return this; } @@ -248,11 +248,11 @@ public FormatTest binary(org.springframework.core.io.Resource binary) { @Valid - public org.springframework.core.io.Resource getBinary() { + public org.springframework.web.multipart.MultipartFile getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(org.springframework.web.multipart.MultipartFile binary) { this.binary = binary; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java index e894f561fc6e..72f64c2b3704 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FormatTest.java @@ -44,7 +44,7 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private org.springframework.web.multipart.MultipartFile binary; @JsonProperty("date") @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) @@ -236,7 +236,7 @@ public void setByte(byte[] _byte) { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(org.springframework.web.multipart.MultipartFile binary) { this.binary = binary; return this; } @@ -249,11 +249,11 @@ public FormatTest binary(org.springframework.core.io.Resource binary) { @Valid - public org.springframework.core.io.Resource getBinary() { + public org.springframework.web.multipart.MultipartFile getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(org.springframework.web.multipart.MultipartFile binary) { this.binary = binary; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java index e894f561fc6e..72f64c2b3704 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FormatTest.java @@ -44,7 +44,7 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private org.springframework.web.multipart.MultipartFile binary; @JsonProperty("date") @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) @@ -236,7 +236,7 @@ public void setByte(byte[] _byte) { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(org.springframework.web.multipart.MultipartFile binary) { this.binary = binary; return this; } @@ -249,11 +249,11 @@ public FormatTest binary(org.springframework.core.io.Resource binary) { @Valid - public org.springframework.core.io.Resource getBinary() { + public org.springframework.web.multipart.MultipartFile getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(org.springframework.web.multipart.MultipartFile binary) { this.binary = binary; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java index e894f561fc6e..72f64c2b3704 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FormatTest.java @@ -44,7 +44,7 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private org.springframework.web.multipart.MultipartFile binary; @JsonProperty("date") @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) @@ -236,7 +236,7 @@ public void setByte(byte[] _byte) { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(org.springframework.web.multipart.MultipartFile binary) { this.binary = binary; return this; } @@ -249,11 +249,11 @@ public FormatTest binary(org.springframework.core.io.Resource binary) { @Valid - public org.springframework.core.io.Resource getBinary() { + public org.springframework.web.multipart.MultipartFile getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(org.springframework.web.multipart.MultipartFile binary) { this.binary = binary; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java index e894f561fc6e..72f64c2b3704 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FormatTest.java @@ -44,7 +44,7 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private org.springframework.web.multipart.MultipartFile binary; @JsonProperty("date") @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) @@ -236,7 +236,7 @@ public void setByte(byte[] _byte) { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(org.springframework.web.multipart.MultipartFile binary) { this.binary = binary; return this; } @@ -249,11 +249,11 @@ public FormatTest binary(org.springframework.core.io.Resource binary) { @Valid - public org.springframework.core.io.Resource getBinary() { + public org.springframework.web.multipart.MultipartFile getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(org.springframework.web.multipart.MultipartFile binary) { this.binary = binary; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/HomeController.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/HomeController.java index b1e5bfc21ee5..5e4aeb0ea868 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/HomeController.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/HomeController.java @@ -3,7 +3,7 @@ import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; -import org.springframework.core.io.Resource; +import org.springframework.web.multipart.MultipartFile; import org.springframework.stereotype.Controller; import org.springframework.util.StreamUtils; import org.springframework.web.bind.annotation.GetMapping; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java index e894f561fc6e..72f64c2b3704 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java @@ -44,7 +44,7 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private org.springframework.web.multipart.MultipartFile binary; @JsonProperty("date") @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) @@ -236,7 +236,7 @@ public void setByte(byte[] _byte) { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(org.springframework.web.multipart.MultipartFile binary) { this.binary = binary; return this; } @@ -249,11 +249,11 @@ public FormatTest binary(org.springframework.core.io.Resource binary) { @Valid - public org.springframework.core.io.Resource getBinary() { + public org.springframework.web.multipart.MultipartFile getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(org.springframework.web.multipart.MultipartFile binary) { this.binary = binary; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java index dedb11fe758b..354373c3d6ce 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FormatTest.java @@ -44,7 +44,7 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private org.springframework.web.multipart.MultipartFile binary; @JsonProperty("date") @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) @@ -236,7 +236,7 @@ public void setByte(byte[] _byte) { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(org.springframework.web.multipart.MultipartFile binary) { this.binary = binary; return this; } @@ -249,11 +249,11 @@ public FormatTest binary(org.springframework.core.io.Resource binary) { @Valid - public org.springframework.core.io.Resource getBinary() { + public org.springframework.web.multipart.MultipartFile getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(org.springframework.web.multipart.MultipartFile binary) { this.binary = binary; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java index e894f561fc6e..72f64c2b3704 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FormatTest.java @@ -44,7 +44,7 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private org.springframework.web.multipart.MultipartFile binary; @JsonProperty("date") @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) @@ -236,7 +236,7 @@ public void setByte(byte[] _byte) { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(org.springframework.web.multipart.MultipartFile binary) { this.binary = binary; return this; } @@ -249,11 +249,11 @@ public FormatTest binary(org.springframework.core.io.Resource binary) { @Valid - public org.springframework.core.io.Resource getBinary() { + public org.springframework.web.multipart.MultipartFile getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(org.springframework.web.multipart.MultipartFile binary) { this.binary = binary; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java index dedb11fe758b..354373c3d6ce 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FormatTest.java @@ -44,7 +44,7 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private org.springframework.web.multipart.MultipartFile binary; @JsonProperty("date") @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) @@ -236,7 +236,7 @@ public void setByte(byte[] _byte) { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(org.springframework.web.multipart.MultipartFile binary) { this.binary = binary; return this; } @@ -249,11 +249,11 @@ public FormatTest binary(org.springframework.core.io.Resource binary) { @Valid - public org.springframework.core.io.Resource getBinary() { + public org.springframework.web.multipart.MultipartFile getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(org.springframework.web.multipart.MultipartFile binary) { this.binary = binary; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java index e894f561fc6e..72f64c2b3704 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FormatTest.java @@ -44,7 +44,7 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private org.springframework.web.multipart.MultipartFile binary; @JsonProperty("date") @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) @@ -236,7 +236,7 @@ public void setByte(byte[] _byte) { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(org.springframework.web.multipart.MultipartFile binary) { this.binary = binary; return this; } @@ -249,11 +249,11 @@ public FormatTest binary(org.springframework.core.io.Resource binary) { @Valid - public org.springframework.core.io.Resource getBinary() { + public org.springframework.web.multipart.MultipartFile getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(org.springframework.web.multipart.MultipartFile binary) { this.binary = binary; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java index e894f561fc6e..72f64c2b3704 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java @@ -44,7 +44,7 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private org.springframework.web.multipart.MultipartFile binary; @JsonProperty("date") @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) @@ -236,7 +236,7 @@ public void setByte(byte[] _byte) { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(org.springframework.web.multipart.MultipartFile binary) { this.binary = binary; return this; } @@ -249,11 +249,11 @@ public FormatTest binary(org.springframework.core.io.Resource binary) { @Valid - public org.springframework.core.io.Resource getBinary() { + public org.springframework.web.multipart.MultipartFile getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(org.springframework.web.multipart.MultipartFile binary) { this.binary = binary; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java index d58e787c3684..07241a089c8a 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FormatTest.java @@ -44,7 +44,7 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private org.springframework.web.multipart.MultipartFile binary; @JsonProperty("date") @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) @@ -236,7 +236,7 @@ public void setByte(byte[] _byte) { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(org.springframework.web.multipart.MultipartFile binary) { this.binary = binary; return this; } @@ -249,11 +249,11 @@ public FormatTest binary(org.springframework.core.io.Resource binary) { @Valid - public org.springframework.core.io.Resource getBinary() { + public org.springframework.web.multipart.MultipartFile getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(org.springframework.web.multipart.MultipartFile binary) { this.binary = binary; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTest.java index e894f561fc6e..72f64c2b3704 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FormatTest.java @@ -44,7 +44,7 @@ public class FormatTest { private byte[] _byte; @JsonProperty("binary") - private org.springframework.core.io.Resource binary; + private org.springframework.web.multipart.MultipartFile binary; @JsonProperty("date") @org.springframework.format.annotation.DateTimeFormat(iso = org.springframework.format.annotation.DateTimeFormat.ISO.DATE) @@ -236,7 +236,7 @@ public void setByte(byte[] _byte) { this._byte = _byte; } - public FormatTest binary(org.springframework.core.io.Resource binary) { + public FormatTest binary(org.springframework.web.multipart.MultipartFile binary) { this.binary = binary; return this; } @@ -249,11 +249,11 @@ public FormatTest binary(org.springframework.core.io.Resource binary) { @Valid - public org.springframework.core.io.Resource getBinary() { + public org.springframework.web.multipart.MultipartFile getBinary() { return binary; } - public void setBinary(org.springframework.core.io.Resource binary) { + public void setBinary(org.springframework.web.multipart.MultipartFile binary) { this.binary = binary; }