From a4f1d1b5b1c3054d60ba02db6211da781f48acb1 Mon Sep 17 00:00:00 2001 From: stephanpelikan Date: Fri, 4 Dec 2020 08:09:06 +0100 Subject: [PATCH] Fix for 'Reactive paramter ServerWebExchange's properties appear in Swagger-UI' (#8031) (#8032) * [Spring] Add @ApiIgnore to parameter ServerWebExchange of reactive style (#8031) * [Spring] Apply contribution guidelines (#8031) --- .../main/resources/JavaSpring/api.mustache | 4 +-- .../org/openapitools/api/AnotherFakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 30 +++++++++---------- .../api/FakeClassnameTestApi.java | 2 +- .../java/org/openapitools/api/PetApi.java | 16 +++++----- .../java/org/openapitools/api/StoreApi.java | 8 ++--- .../java/org/openapitools/api/UserApi.java | 16 +++++----- 7 files changed, 39 insertions(+), 39 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache index ec1d5c7f385..ae7857fb6b1 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/api.mustache @@ -125,13 +125,13 @@ public interface {{classname}} { produces = { {{#produces}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/produces}} }{{/hasProduces}}{{#hasConsumes}}, consumes = { {{#consumes}}"{{{mediaType}}}"{{^-last}}, {{/-last}}{{/consumes}} }{{/hasConsumes}}{{/singleContentTypes}} ) - {{#jdk8-default-interface}}default {{/jdk8-default-interface}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{#delegate-method}}_{{/delegate-method}}{{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{>cookieParams}}{{^-last}},{{/-last}}{{#-last}}{{#reactive}}, {{/reactive}}{{/-last}}{{/allParams}}{{#reactive}}ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}, @ApiIgnore final Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{^jdk8-default-interface}};{{/jdk8-default-interface}}{{#jdk8-default-interface}}{{#unhandledException}} throws Exception{{/unhandledException}} { + {{#jdk8-default-interface}}default {{/jdk8-default-interface}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{#delegate-method}}_{{/delegate-method}}{{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{>cookieParams}}{{^-last}},{{/-last}}{{#-last}}{{#reactive}}, {{/reactive}}{{/-last}}{{/allParams}}{{#reactive}}@ApiIgnore final ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}, @ApiIgnore final Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{^jdk8-default-interface}};{{/jdk8-default-interface}}{{#jdk8-default-interface}}{{#unhandledException}} throws Exception{{/unhandledException}} { {{#delegate-method}} return {{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}, pageable{{/vendorExtensions.x-spring-paginated}}); } // Override this method - {{#jdk8-default-interface}}default {{/jdk8-default-interface}} {{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{#allParams}}{{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isArray}}Mono{{/isArray}}{{#isArray}}Flux{{/isArray}}<{{{baseType}}}>{{/reactive}}{{/isBodyParam}}{{/isFile}}{{#isFile}}{{#reactive}}Flux{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}, @ApiIgnore final Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{#unhandledException}} throws Exception{{/unhandledException}} { + {{#jdk8-default-interface}}default {{/jdk8-default-interface}} {{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{#allParams}}{{^isFile}}{{^isBodyParam}}{{>optionalDataType}}{{/isBodyParam}}{{#isBodyParam}}{{^reactive}}{{{dataType}}}{{/reactive}}{{#reactive}}{{^isArray}}Mono{{/isArray}}{{#isArray}}Flux{{/isArray}}<{{{baseType}}}>{{/reactive}}{{/isBodyParam}}{{/isFile}}{{#isFile}}{{#reactive}}Flux{{/reactive}}{{^reactive}}MultipartFile{{/reactive}}{{/isFile}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}{{#reactive}}{{#hasParams}}, {{/hasParams}}@ApiIgnore final ServerWebExchange exchange{{/reactive}}{{#vendorExtensions.x-spring-paginated}}, @ApiIgnore final Pageable pageable{{/vendorExtensions.x-spring-paginated}}){{#unhandledException}} throws Exception{{/unhandledException}} { {{/delegate-method}} {{^isDelegate}} {{>methodBody}} diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java index fcf30df085f..ff1fc315baf 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -46,7 +46,7 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - default Mono> call123testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Mono body, ServerWebExchange exchange) { + default Mono> call123testSpecialTags(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Mono body, @ApiIgnore final ServerWebExchange exchange) { return getDelegate().call123testSpecialTags(body, 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 f81b98101a1..13649658b4b 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 @@ -55,7 +55,7 @@ public interface FakeApi { value = "/fake/create_xml_item", consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) - default Mono> createXmlItem(@ApiParam(value = "XmlItem Body" ,required=true ) @Valid @RequestBody Mono xmlItem, ServerWebExchange exchange) { + default Mono> createXmlItem(@ApiParam(value = "XmlItem Body" ,required=true ) @Valid @RequestBody Mono xmlItem, @ApiIgnore final ServerWebExchange exchange) { return getDelegate().createXmlItem(xmlItem, exchange); } @@ -74,7 +74,7 @@ public interface FakeApi { value = "/fake/outer/boolean", produces = { "*/*" } ) - default Mono> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Mono body, ServerWebExchange exchange) { + default Mono> fakeOuterBooleanSerialize(@ApiParam(value = "Input boolean as post body" ) @Valid @RequestBody(required = false) Mono body, @ApiIgnore final ServerWebExchange exchange) { return getDelegate().fakeOuterBooleanSerialize(body, exchange); } @@ -93,7 +93,7 @@ public interface FakeApi { value = "/fake/outer/composite", produces = { "*/*" } ) - default Mono> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) Mono body, ServerWebExchange exchange) { + default Mono> fakeOuterCompositeSerialize(@ApiParam(value = "Input composite as post body" ) @Valid @RequestBody(required = false) Mono body, @ApiIgnore final ServerWebExchange exchange) { return getDelegate().fakeOuterCompositeSerialize(body, exchange); } @@ -112,7 +112,7 @@ public interface FakeApi { value = "/fake/outer/number", produces = { "*/*" } ) - default Mono> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) Mono body, ServerWebExchange exchange) { + default Mono> fakeOuterNumberSerialize(@ApiParam(value = "Input number as post body" ) @Valid @RequestBody(required = false) Mono body, @ApiIgnore final ServerWebExchange exchange) { return getDelegate().fakeOuterNumberSerialize(body, exchange); } @@ -131,7 +131,7 @@ public interface FakeApi { value = "/fake/outer/string", produces = { "*/*" } ) - default Mono> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) Mono body, ServerWebExchange exchange) { + default Mono> fakeOuterStringSerialize(@ApiParam(value = "Input string as post body" ) @Valid @RequestBody(required = false) Mono body, @ApiIgnore final ServerWebExchange exchange) { return getDelegate().fakeOuterStringSerialize(body, exchange); } @@ -150,7 +150,7 @@ public interface FakeApi { value = "/fake/body-with-file-schema", consumes = { "application/json" } ) - default Mono> testBodyWithFileSchema(@ApiParam(value = "" ,required=true ) @Valid @RequestBody Mono body, ServerWebExchange exchange) { + default Mono> testBodyWithFileSchema(@ApiParam(value = "" ,required=true ) @Valid @RequestBody Mono body, @ApiIgnore final ServerWebExchange exchange) { return getDelegate().testBodyWithFileSchema(body, exchange); } @@ -169,7 +169,7 @@ public interface FakeApi { value = "/fake/body-with-query-params", consumes = { "application/json" } ) - default Mono> testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "" ,required=true ) @Valid @RequestBody Mono body, ServerWebExchange exchange) { + default Mono> testBodyWithQueryParams(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query,@ApiParam(value = "" ,required=true ) @Valid @RequestBody Mono body, @ApiIgnore final ServerWebExchange exchange) { return getDelegate().testBodyWithQueryParams(query, body, exchange); } @@ -189,7 +189,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - default Mono> testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Mono body, ServerWebExchange exchange) { + default Mono> testClientModel(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Mono body, @ApiIgnore final ServerWebExchange exchange) { return getDelegate().testClientModel(body, exchange); } @@ -226,7 +226,7 @@ public interface FakeApi { value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - default Mono> testEndpointParameters(@ApiParam(value = "None", required=true) @Valid @RequestPart(value = "number", required = true) BigDecimal number,@ApiParam(value = "None", required=true) @Valid @RequestPart(value = "double", required = true) Double _double,@ApiParam(value = "None", required=true) @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") @Valid @RequestPart(value = "integer", required = false) Integer integer,@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32,@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") @Valid @RequestPart(value = "binary", required = false) Flux binary,@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date,@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime,@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password,@ApiParam(value = "None") @Valid @RequestPart(value = "callback", required = false) String paramCallback, ServerWebExchange exchange) { + default Mono> testEndpointParameters(@ApiParam(value = "None", required=true) @Valid @RequestPart(value = "number", required = true) BigDecimal number,@ApiParam(value = "None", required=true) @Valid @RequestPart(value = "double", required = true) Double _double,@ApiParam(value = "None", required=true) @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") @Valid @RequestPart(value = "integer", required = false) Integer integer,@ApiParam(value = "None") @Valid @RequestPart(value = "int32", required = false) Integer int32,@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") @Valid @RequestPart(value = "binary", required = false) Flux binary,@ApiParam(value = "None") @Valid @RequestPart(value = "date", required = false) LocalDate date,@ApiParam(value = "None") @Valid @RequestPart(value = "dateTime", required = false) OffsetDateTime dateTime,@ApiParam(value = "None") @Valid @RequestPart(value = "password", required = false) String password,@ApiParam(value = "None") @Valid @RequestPart(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); } @@ -254,7 +254,7 @@ public interface FakeApi { value = "/fake", consumes = { "application/x-www-form-urlencoded" } ) - default Mono> testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@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) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @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, ServerWebExchange exchange) { + default Mono> testEnumParameters(@ApiParam(value = "Header parameter enum test (string array)" , allowableValues=">, $") @RequestHeader(value="enum_header_string_array", required=false) List enumHeaderStringArray,@ApiParam(value = "Header parameter enum test (string)" , allowableValues="_abc, -efg, (xyz)", defaultValue="-efg") @RequestHeader(value="enum_header_string", required=false) String enumHeaderString,@ApiParam(value = "Query parameter enum test (string array)", allowableValues = ">, $") @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray,@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) Integer enumQueryInteger,@ApiParam(value = "Query parameter enum test (double)", allowableValues = "1.1, -1.2") @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble,@ApiParam(value = "Form parameter enum test (string array)", allowableValues=">, $") @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, @ApiIgnore final ServerWebExchange exchange) { return getDelegate().testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, exchange); } @@ -277,7 +277,7 @@ public interface FakeApi { @DeleteMapping( value = "/fake" ) - default Mono> testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters" ,required=true) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group, ServerWebExchange exchange) { + default Mono> testGroupParameters(@NotNull @ApiParam(value = "Required String in group parameters", required = true) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup,@ApiParam(value = "Required Boolean in group parameters" ,required=true) @RequestHeader(value="required_boolean_group", required=true) Boolean requiredBooleanGroup,@NotNull @ApiParam(value = "Required Integer in group parameters", required = true) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group,@ApiParam(value = "String in group parameters") @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup,@ApiParam(value = "Boolean in group parameters" ) @RequestHeader(value="boolean_group", required=false) Boolean booleanGroup,@ApiParam(value = "Integer in group parameters") @Valid @RequestParam(value = "int64_group", required = false) Long int64Group, @ApiIgnore final ServerWebExchange exchange) { return getDelegate().testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, exchange); } @@ -295,7 +295,7 @@ public interface FakeApi { value = "/fake/inline-additionalProperties", consumes = { "application/json" } ) - default Mono> testInlineAdditionalProperties(@ApiParam(value = "request body" ,required=true ) @Valid @RequestBody Mono param, ServerWebExchange exchange) { + default Mono> testInlineAdditionalProperties(@ApiParam(value = "request body" ,required=true ) @Valid @RequestBody Mono param, @ApiIgnore final ServerWebExchange exchange) { return getDelegate().testInlineAdditionalProperties(param, exchange); } @@ -314,7 +314,7 @@ public interface FakeApi { value = "/fake/jsonFormData", 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, ServerWebExchange exchange) { + 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, @ApiIgnore final ServerWebExchange exchange) { return getDelegate().testJsonFormData(param, param2, exchange); } @@ -336,7 +336,7 @@ public interface FakeApi { @PutMapping( value = "/fake/test-query-paramters" ) - default Mono> testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context, ServerWebExchange exchange) { + default Mono> testQueryParameterCollectionFormat(@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url,@NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context, @ApiIgnore final ServerWebExchange exchange) { return getDelegate().testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, exchange); } @@ -361,7 +361,7 @@ public interface FakeApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default Mono> uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) Flux requiredFile,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, ServerWebExchange exchange) { + default Mono> uploadFileWithRequiredFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "file to upload") @Valid @RequestPart(value = "requiredFile", required = true) Flux requiredFile,@ApiParam(value = "Additional data to pass to server") @Valid @RequestPart(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/FakeClassnameTestApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index c3b20769cdf..cd22e4cddee 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -49,7 +49,7 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) - default Mono> testClassname(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Mono body, ServerWebExchange exchange) { + default Mono> testClassname(@ApiParam(value = "client model" ,required=true ) @Valid @RequestBody Mono body, @ApiIgnore final ServerWebExchange exchange) { return getDelegate().testClassname(body, 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 0dae51dcf97..30dffb52b66 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 @@ -53,7 +53,7 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) - default Mono> addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Mono body, ServerWebExchange exchange) { + default Mono> addPet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Mono body, @ApiIgnore final ServerWebExchange exchange) { return getDelegate().addPet(body, exchange); } @@ -77,7 +77,7 @@ public interface PetApi { @DeleteMapping( value = "/pet/{petId}" ) - default Mono> deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey, ServerWebExchange exchange) { + default Mono> deletePet(@ApiParam(value = "Pet id to delete",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "" ) @RequestHeader(value="api_key", required=false) String apiKey, @ApiIgnore final ServerWebExchange exchange) { return getDelegate().deletePet(petId, apiKey, exchange); } @@ -102,7 +102,7 @@ public interface PetApi { value = "/pet/findByStatus", produces = { "application/xml", "application/json" } ) - default Mono>> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, ServerWebExchange exchange) { + default Mono>> findPetsByStatus(@NotNull @ApiParam(value = "Status values that need to be considered for filter", required = true, allowableValues = "available, pending, sold") @Valid @RequestParam(value = "status", required = true) List status, @ApiIgnore final ServerWebExchange exchange) { return getDelegate().findPetsByStatus(status, exchange); } @@ -128,7 +128,7 @@ public interface PetApi { value = "/pet/findByTags", produces = { "application/xml", "application/json" } ) - default Mono>> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags, ServerWebExchange exchange) { + default Mono>> findPetsByTags(@NotNull @ApiParam(value = "Tags to filter by", required = true) @Valid @RequestParam(value = "tags", required = true) Set tags, @ApiIgnore final ServerWebExchange exchange) { return getDelegate().findPetsByTags(tags, exchange); } @@ -154,7 +154,7 @@ public interface PetApi { value = "/pet/{petId}", produces = { "application/xml", "application/json" } ) - default Mono> getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathVariable("petId") Long petId, ServerWebExchange exchange) { + default Mono> getPetById(@ApiParam(value = "ID of pet to return",required=true) @PathVariable("petId") Long petId, @ApiIgnore final ServerWebExchange exchange) { return getDelegate().getPetById(petId, exchange); } @@ -182,7 +182,7 @@ public interface PetApi { value = "/pet", consumes = { "application/json", "application/xml" } ) - default Mono> updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Mono body, ServerWebExchange exchange) { + default Mono> updatePet(@ApiParam(value = "Pet object that needs to be added to the store" ,required=true ) @Valid @RequestBody Mono body, @ApiIgnore final ServerWebExchange exchange) { return getDelegate().updatePet(body, exchange); } @@ -206,7 +206,7 @@ public interface PetApi { value = "/pet/{petId}", consumes = { "application/x-www-form-urlencoded" } ) - default Mono> updatePetWithForm(@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, ServerWebExchange exchange) { + default Mono> updatePetWithForm(@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, @ApiIgnore final ServerWebExchange exchange) { return getDelegate().updatePetWithForm(petId, name, status, exchange); } @@ -231,7 +231,7 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" } ) - 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") @Valid @RequestPart(value = "file", required = false) Flux file, ServerWebExchange exchange) { + 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") @Valid @RequestPart(value = "file", required = false) Flux 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/StoreApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java index d9a213eb3db..5f81651e913 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java @@ -47,7 +47,7 @@ public interface StoreApi { @DeleteMapping( value = "/store/order/{order_id}" ) - default Mono> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathVariable("order_id") String orderId, ServerWebExchange exchange) { + default Mono> deleteOrder(@ApiParam(value = "ID of the order that needs to be deleted",required=true) @PathVariable("order_id") String orderId, @ApiIgnore final ServerWebExchange exchange) { return getDelegate().deleteOrder(orderId, exchange); } @@ -68,7 +68,7 @@ public interface StoreApi { value = "/store/inventory", produces = { "application/json" } ) - default Mono>> getInventory(ServerWebExchange exchange) { + default Mono>> getInventory(@ApiIgnore final ServerWebExchange exchange) { return getDelegate().getInventory(exchange); } @@ -91,7 +91,7 @@ public interface StoreApi { value = "/store/order/{order_id}", produces = { "application/xml", "application/json" } ) - default Mono> getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId, ServerWebExchange exchange) { + default Mono> getOrderById(@Min(1L) @Max(5L) @ApiParam(value = "ID of pet that needs to be fetched",required=true) @PathVariable("order_id") Long orderId, @ApiIgnore final ServerWebExchange exchange) { return getDelegate().getOrderById(orderId, exchange); } @@ -111,7 +111,7 @@ public interface StoreApi { value = "/store/order", produces = { "application/xml", "application/json" } ) - default Mono> placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Mono body, ServerWebExchange exchange) { + default Mono> placeOrder(@ApiParam(value = "order placed for purchasing the pet" ,required=true ) @Valid @RequestBody Mono body, @ApiIgnore final ServerWebExchange exchange) { return getDelegate().placeOrder(body, exchange); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java index 9689321dcdb..ab86af2a61e 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java @@ -45,7 +45,7 @@ public interface UserApi { @PostMapping( value = "/user" ) - default Mono> createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody Mono body, ServerWebExchange exchange) { + default Mono> createUser(@ApiParam(value = "Created user object" ,required=true ) @Valid @RequestBody Mono body, @ApiIgnore final ServerWebExchange exchange) { return getDelegate().createUser(body, exchange); } @@ -62,7 +62,7 @@ public interface UserApi { @PostMapping( value = "/user/createWithArray" ) - default Mono> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody Flux body, ServerWebExchange exchange) { + default Mono> createUsersWithArrayInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody Flux body, @ApiIgnore final ServerWebExchange exchange) { return getDelegate().createUsersWithArrayInput(body, exchange); } @@ -79,7 +79,7 @@ public interface UserApi { @PostMapping( value = "/user/createWithList" ) - default Mono> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody Flux body, ServerWebExchange exchange) { + default Mono> createUsersWithListInput(@ApiParam(value = "List of user object" ,required=true ) @Valid @RequestBody Flux body, @ApiIgnore final ServerWebExchange exchange) { return getDelegate().createUsersWithListInput(body, exchange); } @@ -99,7 +99,7 @@ public interface UserApi { @DeleteMapping( value = "/user/{username}" ) - default Mono> deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username, ServerWebExchange exchange) { + default Mono> deleteUser(@ApiParam(value = "The name that needs to be deleted",required=true) @PathVariable("username") String username, @ApiIgnore final ServerWebExchange exchange) { return getDelegate().deleteUser(username, exchange); } @@ -121,7 +121,7 @@ public interface UserApi { value = "/user/{username}", produces = { "application/xml", "application/json" } ) - default Mono> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.",required=true) @PathVariable("username") String username, ServerWebExchange exchange) { + default Mono> getUserByName(@ApiParam(value = "The name that needs to be fetched. Use user1 for testing.",required=true) @PathVariable("username") String username, @ApiIgnore final ServerWebExchange exchange) { return getDelegate().getUserByName(username, exchange); } @@ -142,7 +142,7 @@ public interface UserApi { value = "/user/login", produces = { "application/xml", "application/json" } ) - default Mono> loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password, ServerWebExchange exchange) { + default Mono> loginUser(@NotNull @ApiParam(value = "The user name for login", required = true) @Valid @RequestParam(value = "username", required = true) String username,@NotNull @ApiParam(value = "The password for login in clear text", required = true) @Valid @RequestParam(value = "password", required = true) String password, @ApiIgnore final ServerWebExchange exchange) { return getDelegate().loginUser(username, password, exchange); } @@ -158,7 +158,7 @@ public interface UserApi { @GetMapping( value = "/user/logout" ) - default Mono> logoutUser(ServerWebExchange exchange) { + default Mono> logoutUser(@ApiIgnore final ServerWebExchange exchange) { return getDelegate().logoutUser(exchange); } @@ -179,7 +179,7 @@ public interface UserApi { @PutMapping( value = "/user/{username}" ) - default Mono> updateUser(@ApiParam(value = "name that need to be deleted",required=true) @PathVariable("username") String username,@ApiParam(value = "Updated user object" ,required=true ) @Valid @RequestBody Mono body, ServerWebExchange exchange) { + default Mono> updateUser(@ApiParam(value = "name that need to be deleted",required=true) @PathVariable("username") String username,@ApiParam(value = "Updated user object" ,required=true ) @Valid @RequestBody Mono body, @ApiIgnore final ServerWebExchange exchange) { return getDelegate().updateUser(username, body, exchange); }