From b7c3f1c823bd61cf9018b954a7c471bd6de620b9 Mon Sep 17 00:00:00 2001 From: Leos Bitto Date: Sun, 11 Oct 2026 10:59:23 +0200 Subject: [PATCH 1/4] improve useBeanValidation to generate @Valid for the returned objects too --- .../codegen/languages/SpringCodegen.java | 8 ++ .../JavaSpring/responseType.mustache | 2 +- .../resources/JavaSpring/returnTypes.mustache | 2 +- .../JavaSpring/validatedReturnType.mustache | 1 + .../JavaValidationArrayPrimitivesTest.java | 7 +- .../java/spring/SpringCodegenTest.java | 101 +++++++++++++-- .../collection-response-validation.yaml | 120 ++++++++++++++++++ 7 files changed, 226 insertions(+), 15 deletions(-) create mode 100644 modules/openapi-generator/src/main/resources/JavaSpring/validatedReturnType.mustache create mode 100644 modules/openapi-generator/src/test/resources/3_0/spring/collection-response-validation.yaml 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 28952fa07e65..c06ada47d708 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 @@ -923,6 +923,14 @@ public void processOpts() { additionalProperties.put("lambdaSplitString", new SplitStringLambda()); + additionalProperties.put("lambdaBeanValidationType", (Mustache.Lambda) (fragment, writer) -> { + String type = fragment.execute(); + int genericStart = type.indexOf('<'); + int qualifierEnd = (genericStart < 0 ? type : type.substring(0, genericStart)).lastIndexOf('.'); + // Type-use annotations belong after the package qualifier, before the simple type name. + writer.write(type.substring(0, qualifierEnd + 1) + "@Valid " + type.substring(qualifierEnd + 1)); + }); + // apiController: hide implementation behind undocumented flag to temporarily preserve code additionalProperties.put("_api_controller_impl_", false); // HEADS-UP: Do not add more template file after this block diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/responseType.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/responseType.mustache index 378585299a50..3a870655d094 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/responseType.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/responseType.mustache @@ -1 +1 @@ -{{^vendorExtensions.x-sse}}{{#reactive}}{{#useResponseEntity}}{{#vendorExtensions.x-reactive-return-except-list-of-string}}MonoreturnTypes}}>>>{{/vendorExtensions.x-reactive-return-except-list-of-string}}{{^vendorExtensions.x-reactive-return-except-list-of-string}}MonoreturnTypes}}{{#isArray}}>{{/isArray}}>>{{/vendorExtensions.x-reactive-return-except-list-of-string}}{{/useResponseEntity}}{{^useResponseEntity}}{{#vendorExtensions.x-reactive-return-except-list-of-string}}Mono<{{{returnContainer}}}<{{>returnTypes}}>>{{/vendorExtensions.x-reactive-return-except-list-of-string}}{{^vendorExtensions.x-reactive-return-except-list-of-string}}{{#isArray}}Flux{{/isArray}}{{^isArray}}Mono{{/isArray}}<{{>returnTypes}}>{{/vendorExtensions.x-reactive-return-except-list-of-string}}{{/useResponseEntity}}{{/reactive}}{{^reactive}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}{{#useResponseEntity}}ResponseEntity<{{/useResponseEntity}}{{>returnTypes}}{{#useResponseEntity}}>{{/useResponseEntity}}{{#responseWrapper}}>{{/responseWrapper}}{{/reactive}}{{/vendorExtensions.x-sse}}{{#vendorExtensions.x-sse}}{{#vendorExtensions.x-reactive-return-except-list-of-string}}{{{returnContainer}}}<{{>returnTypes}}>{{/vendorExtensions.x-reactive-return-except-list-of-string}}{{^vendorExtensions.x-reactive-return-except-list-of-string}}{{#isArray}}Flux{{/isArray}}{{^isArray}}Mono{{/isArray}}<{{>returnTypes}}>{{/vendorExtensions.x-reactive-return-except-list-of-string}}{{/vendorExtensions.x-sse}} \ No newline at end of file +{{#useBeanValidation}}{{^isVoid}}@Valid {{/isVoid}}{{/useBeanValidation}}{{^vendorExtensions.x-sse}}{{#reactive}}{{#useResponseEntity}}{{#vendorExtensions.x-reactive-return-except-list-of-string}}MonoreturnTypes}}>>>{{/vendorExtensions.x-reactive-return-except-list-of-string}}{{^vendorExtensions.x-reactive-return-except-list-of-string}}MonovalidatedReturnType}}>{{/isArray}}{{^isArray}}{{>returnTypes}}{{/isArray}}>>{{/vendorExtensions.x-reactive-return-except-list-of-string}}{{/useResponseEntity}}{{^useResponseEntity}}{{#vendorExtensions.x-reactive-return-except-list-of-string}}Mono<{{{returnContainer}}}<{{>returnTypes}}>>{{/vendorExtensions.x-reactive-return-except-list-of-string}}{{^vendorExtensions.x-reactive-return-except-list-of-string}}{{#isArray}}Flux{{/isArray}}{{^isArray}}Mono{{/isArray}}<{{#isArray}}{{>validatedReturnType}}{{/isArray}}{{^isArray}}{{>returnTypes}}{{/isArray}}>{{/vendorExtensions.x-reactive-return-except-list-of-string}}{{/useResponseEntity}}{{/reactive}}{{^reactive}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}{{#useResponseEntity}}ResponseEntity<{{/useResponseEntity}}{{>returnTypes}}{{#useResponseEntity}}>{{/useResponseEntity}}{{#responseWrapper}}>{{/responseWrapper}}{{/reactive}}{{/vendorExtensions.x-sse}}{{#vendorExtensions.x-sse}}{{#vendorExtensions.x-reactive-return-except-list-of-string}}{{{returnContainer}}}<{{>returnTypes}}>{{/vendorExtensions.x-reactive-return-except-list-of-string}}{{^vendorExtensions.x-reactive-return-except-list-of-string}}{{#isArray}}Flux{{/isArray}}{{^isArray}}Mono{{/isArray}}<{{#isArray}}{{>validatedReturnType}}{{/isArray}}{{^isArray}}{{>returnTypes}}{{/isArray}}>{{/vendorExtensions.x-reactive-return-except-list-of-string}}{{/vendorExtensions.x-sse}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/returnTypes.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/returnTypes.mustache index 757696365aeb..94c1b351e480 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/returnTypes.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/returnTypes.mustache @@ -1 +1 @@ -{{#isMap}}Map{{/isMap}}{{#isArray}}{{#reactive}}{{{returnType}}}{{/reactive}}{{^reactive}}{{#generateGenericResponseEntity}}?{{/generateGenericResponseEntity}}{{^generateGenericResponseEntity}}{{{returnContainer}}}<{{{returnType}}}>{{/generateGenericResponseEntity}}{{/reactive}}{{/isArray}}{{^returnContainer}}{{#useResponseEntity}}{{#generateGenericResponseEntity}}?{{/generateGenericResponseEntity}}{{^generateGenericResponseEntity}}{{{returnType}}}{{/generateGenericResponseEntity}}{{/useResponseEntity}}{{^useResponseEntity}}{{#isDelegate}}{{#isVoid}}{{#responseWrapper}}{{{returnType}}}{{/responseWrapper}}{{^responseWrapper}}void{{/responseWrapper}}{{/isVoid}}{{^isVoid}}{{{returnType}}}{{/isVoid}}{{/isDelegate}}{{^isDelegate}}{{#async}}{{{returnType}}}{{/async}}{{^async}}{{#isVoid}}{{#responseWrapper}}{{{returnType}}}{{/responseWrapper}}{{^responseWrapper}}void{{/responseWrapper}}{{/isVoid}}{{^isVoid}}{{{returnType}}}{{/isVoid}}{{/async}}{{/isDelegate}}{{/useResponseEntity}}{{/returnContainer}} \ No newline at end of file +{{#isMap}}MapvalidatedReturnType}}>{{/isMap}}{{#isArray}}{{#reactive}}{{{returnType}}}{{/reactive}}{{^reactive}}{{#generateGenericResponseEntity}}?{{/generateGenericResponseEntity}}{{^generateGenericResponseEntity}}{{{returnContainer}}}<{{>validatedReturnType}}>{{/generateGenericResponseEntity}}{{/reactive}}{{/isArray}}{{^returnContainer}}{{#useResponseEntity}}{{#generateGenericResponseEntity}}?{{/generateGenericResponseEntity}}{{^generateGenericResponseEntity}}{{{returnType}}}{{/generateGenericResponseEntity}}{{/useResponseEntity}}{{^useResponseEntity}}{{#isDelegate}}{{#isVoid}}{{#responseWrapper}}{{{returnType}}}{{/responseWrapper}}{{^responseWrapper}}void{{/responseWrapper}}{{/isVoid}}{{^isVoid}}{{{returnType}}}{{/isVoid}}{{/isDelegate}}{{^isDelegate}}{{#async}}{{{returnType}}}{{/async}}{{^async}}{{#isVoid}}{{#responseWrapper}}{{{returnType}}}{{/responseWrapper}}{{^responseWrapper}}void{{/responseWrapper}}{{/isVoid}}{{^isVoid}}{{{returnType}}}{{/isVoid}}{{/async}}{{/isDelegate}}{{/useResponseEntity}}{{/returnContainer}} \ No newline at end of file diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/validatedReturnType.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/validatedReturnType.mustache new file mode 100644 index 000000000000..1107f56999b3 --- /dev/null +++ b/modules/openapi-generator/src/main/resources/JavaSpring/validatedReturnType.mustache @@ -0,0 +1 @@ +{{#useBeanValidation}}{{#returnProperty.items.isModel}}{{#lambdaBeanValidationType}}{{{returnType}}}{{/lambdaBeanValidationType}}{{/returnProperty.items.isModel}}{{^returnProperty.items.isModel}}{{{returnType}}}{{/returnProperty.items.isModel}}{{/useBeanValidation}}{{^useBeanValidation}}{{{returnType}}}{{/useBeanValidation}} \ No newline at end of file diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaValidationArrayPrimitivesTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaValidationArrayPrimitivesTest.java index 1624088ba4e2..45607603c3e0 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaValidationArrayPrimitivesTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaValidationArrayPrimitivesTest.java @@ -464,21 +464,20 @@ public void typeMappingsForCollections(Map typeMappings, String JavaFileAssert.assertThat(files.get("ListOfObjectsApi.java")) .fileContains( - "ResponseEntity<" + arrayMapping + ">", + "ResponseEntity<" + arrayMapping + "<@Valid ListOfObjectsInner>>", arrayMapping + "<@Valid ListOfObjectsInner> listOfObjectsInner") .fileContainsPattern("@Size\\(min = 5\\)\\s*@RequestBody"); - String myItem = typeMappings.getOrDefault("MyItem", "MyItem"); JavaFileAssert.assertThat(files.get("ListOfQualifiedItemApi.java")) .fileContains( - "ResponseEntity<" + arrayMapping + "<" + myItem + ">>", + "ResponseEntity<" + arrayMapping + "<" + expectedMyItemArgument + ">>", arrayMapping + "<" + expectedMyItemArgument + ">"); if (!typeMappings.containsKey("array")) { // the mapping to Set is done automatically with uniqueItems: true JavaFileAssert.assertThat(files.get("ListOfUniqueItemApi.java")) .fileContains( - "ResponseEntity>", + "ResponseEntity>", "Set<" + expectedMyItemArgument + "> "); } } 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 2ef43fc25bfa..a8584abbb994 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 @@ -1969,7 +1969,7 @@ public void reactiveArrayShouldBeWrappedInFluxWithoutMono() throws IOException { .assertThat(files.get("PetApi.java")) .assertMethod("addPet").hasReturnType("Mono") .toFileAssert() - .assertMethod("findPetsByStatus").hasReturnType("Flux") + .assertMethod("findPetsByStatus").hasReturnType("Flux<@Valid Pet>") .toFileAssert() .assertMethod("deletePet").hasReturnType("Mono"); } @@ -1991,7 +1991,7 @@ public void reactiveArrayShouldBeWrappedInMonoFluxWhenUsingResponseEntity() thro .assertThat(files.get("PetApi.java")) .assertMethod("addPet").hasReturnType("Mono>") .toFileAssert() - .assertMethod("findPetsByStatus").hasReturnType("Mono>>") + .assertMethod("findPetsByStatus").hasReturnType("Mono>>") .toFileAssert() .assertMethod("deletePet").hasReturnType("Mono>"); } @@ -2817,15 +2817,15 @@ public void testResponseWithArray_issue11897() throws Exception { Map files = generateFromContract("src/test/resources/bugs/issue_11897.yaml", SPRING_BOOT, additionalProperties); JavaFileAssert.assertThat(files.get("MetadataApi.java")) - .assertMethod("getWithArrayOfObjects").hasReturnType("ResponseEntity>") + .assertMethod("getWithArrayOfObjects").hasReturnType("ResponseEntity>") .toFileAssert() .assertMethod("getWithArrayOfString").hasReturnType("ResponseEntity>") .toFileAssert() - .assertMethod("getWithSetOfObjects").hasReturnType("ResponseEntity>") + .assertMethod("getWithSetOfObjects").hasReturnType("ResponseEntity>") .toFileAssert() .assertMethod("getWithSetOfStrings").hasReturnType("ResponseEntity>") .toFileAssert() - .assertMethod("getWithMapOfObjects").hasReturnType("ResponseEntity>") + .assertMethod("getWithMapOfObjects").hasReturnType("ResponseEntity>") .toFileAssert() .assertMethod("getWithMapOfStrings").hasReturnType("ResponseEntity>"); } @@ -3455,6 +3455,89 @@ public void useBeanValidationGenerateAnnotationsForRequestBody_issue13932() thro .containsWithNameAndAttributes("Min", ImmutableMap.of("value", "2")); } + @DataProvider + public Object[][] collectionResponseValidationOptions() { + return new Object[][] { + {true, false, true, false}, {false, false, true, false}, + {true, false, false, false}, {false, false, false, false}, + {true, true, true, false}, {false, true, true, false}, + {true, true, false, false}, {false, true, false, false}, + {true, false, true, true}, {false, false, true, true}, + {true, false, false, true}, {false, false, false, true}, + {true, true, true, true}, {false, true, true, true}, + {true, true, false, true}, {false, true, false, true} + }; + } + + @Test(dataProvider = "collectionResponseValidationOptions") + public void validatesNonVoidReturnsAndObjectCollectionElements(boolean validation, boolean reactive, + boolean responseEntity, boolean mappedModel) throws IOException { + OpenAPI openAPI = new OpenAPIParser().readLocation( + "src/test/resources/3_0/spring/collection-response-validation.yaml", null, new ParseOptions()).getOpenAPI(); + SpringCodegen codegen = new SpringCodegen(); + codegen.setOutputDir(Files.createTempDirectory("collection-response-validation").toString()); + codegen.additionalProperties().put(USE_TAGS, true); + codegen.additionalProperties().put(INTERFACE_ONLY, true); + codegen.additionalProperties().put(USE_BEANVALIDATION, validation); + codegen.additionalProperties().put(REACTIVE, reactive); + codegen.additionalProperties().put(USE_RESPONSE_ENTITY, responseEntity); + if (mappedModel) { + codegen.schemaMapping().put("Pet", "com.example.ExternalPet"); + } + + DefaultGenerator generator = new DefaultGenerator(); + generator.setGenerateMetadata(false); + Map files = generator.opts(new ClientOptInput().openAPI(openAPI).config(codegen)) + .generate().stream().collect(Collectors.toMap(File::getName, Function.identity())); + String api = Files.readString(files.get("CollectionApi.java").toPath()); + String model = mappedModel ? "com.example.ExternalPet" : "Pet"; + String element = validation ? (mappedModel ? "com.example.@Valid ExternalPet" : "@Valid Pet") : model; + String list = reactive ? "Flux<" + element + ">" : "List<" + element + ">"; + String set = reactive ? "Flux<" + element + ">" : "Set<" + element + ">"; + String map = "Map"; + String strings = "List"; + String integers = reactive ? "Flux" : "List"; + String stringMap = "Map"; + String pet = model; + String name = "String"; + String noContent = responseEntity ? "ResponseEntity" : (reactive ? "Void" : "void"); + if (responseEntity) { + list = "ResponseEntity<" + list + ">"; + set = "ResponseEntity<" + set + ">"; + map = "ResponseEntity<" + map + ">"; + strings = "ResponseEntity<" + strings + ">"; + integers = "ResponseEntity<" + integers + ">"; + stringMap = "ResponseEntity<" + stringMap + ">"; + pet = "ResponseEntity<" + pet + ">"; + name = "ResponseEntity<" + name + ">"; + } + if (reactive) { + if (responseEntity) { + list = "Mono<" + list + ">"; + set = "Mono<" + set + ">"; + integers = "Mono<" + integers + ">"; + } + map = "Mono<" + map + ">"; + strings = "Mono<" + strings + ">"; + stringMap = "Mono<" + stringMap + ">"; + pet = "Mono<" + pet + ">"; + name = "Mono<" + name + ">"; + noContent = "Mono<" + noContent + ">"; + } + String annotation = validation ? "@Valid " : ""; + assertThat(api).contains(annotation + list + " getPets(", annotation + set + " getUniquePets(", + annotation + map + " getPetsByName(", annotation + strings + " getNames(", + annotation + pet + " getPet(", annotation + integers + " getNumbers(", + annotation + stringMap + " getNamesById(", annotation + name + " getName(", + "default " + noContent + " getNothing(") + .doesNotContain("ResponseEntity<@Valid", "Mono<@Valid", "List<@Valid String", "Flux<@Valid Integer", + "ResponseEntity") + .hasReturnType("Flux<@Valid EventType>") .toFileAssert() .assertMethod("nonSSE", "ServerWebExchange") .isNotNull() @@ -5592,7 +5675,7 @@ public void testSSEOperationSupport() throws Exception { .toFileAssert() .assertMethod("sseVariant2", "ServerWebExchange") .isNotNull() - .hasReturnType("Flux") + .hasReturnType("Flux<@Valid EventType>") .bodyContainsLines("return Flux.empty();") .toFileAssert() .assertMethod("nonSSE", "ServerWebExchange") @@ -6586,7 +6669,7 @@ public void testGenericReturnTypeWhenNotUsingResponseEntity_issue1096() throws I JavaFileAssert.assertThat(files.get("PetApi.java")) .assertMethod("getPetById").hasReturnType("Pet") .toFileAssert() - .assertMethod("findPetsByStatus").hasReturnType("List"); + .assertMethod("findPetsByStatus").hasReturnType("List<@Valid Pet>"); } @Test @@ -8603,7 +8686,7 @@ public void substituteGenericPagedModel_doesNotReplaceNonPagedReturnType() throw JavaFileAssert.assertThat(files.get("PetApi.java")) .assertMethod("findPets") - .hasReturnType("ResponseEntity>"); + .hasReturnType("ResponseEntity>"); } /** Common properties shared by all substituteGenericPagedModel tests. */ diff --git a/modules/openapi-generator/src/test/resources/3_0/spring/collection-response-validation.yaml b/modules/openapi-generator/src/test/resources/3_0/spring/collection-response-validation.yaml new file mode 100644 index 000000000000..dc39a12f4466 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/spring/collection-response-validation.yaml @@ -0,0 +1,120 @@ +openapi: 3.0.3 +info: + title: Collection response validation + version: 1.0.0 +paths: + /pets: + get: + operationId: getPets + tags: [collection] + responses: + '200': + description: Pets + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + /unique-pets: + get: + operationId: getUniquePets + tags: [collection] + responses: + '200': + description: Unique pets + content: + application/json: + schema: + type: array + uniqueItems: true + items: + $ref: '#/components/schemas/Pet' + /pets-by-name: + get: + operationId: getPetsByName + tags: [collection] + responses: + '200': + description: Pets by name + content: + application/json: + schema: + type: object + additionalProperties: + $ref: '#/components/schemas/Pet' + /names: + get: + operationId: getNames + tags: [collection] + responses: + '200': + description: Names + content: + application/json: + schema: + type: array + items: + type: string + /numbers: + get: + operationId: getNumbers + tags: [collection] + responses: + '200': + description: Numbers + content: + application/json: + schema: + type: array + items: + type: integer + /names-by-id: + get: + operationId: getNamesById + tags: [collection] + responses: + '200': + description: Names by ID + content: + application/json: + schema: + type: object + additionalProperties: + type: string + /pet: + get: + operationId: getPet + tags: [collection] + responses: + '200': + description: Pet + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + /name: + get: + operationId: getName + tags: [collection] + responses: + '200': + description: Name + content: + application/json: + schema: + type: string + /nothing: + get: + operationId: getNothing + tags: [collection] + responses: + '204': + description: No content +components: + schemas: + Pet: + type: object + properties: + name: + type: string From 671d12fa1c47efc8537fa962abd1c3eb929f2c10 Mon Sep 17 00:00:00 2001 From: Leos Bitto Date: Sun, 11 Oct 2026 11:10:05 +0200 Subject: [PATCH 2/4] generated samples --- .../java/org/openapitools/api/PetApi.java | 8 ++-- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../java/org/openapitools/api/PetApi.java | 12 +++--- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../org/openapitools/api/PetController.java | 8 ++-- .../org/openapitools/api/StoreController.java | 6 +-- .../org/openapitools/api/UserController.java | 4 +- .../java/org/openapitools/api/PetApi.java | 12 +++--- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../org/openapitools/api/AnotherFakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 16 ++++---- .../api/FakeClassnameTestApi.java | 2 +- .../java/org/openapitools/api/PetApi.java | 8 ++-- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../org/openapitools/api/AnotherFakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 16 ++++---- .../api/FakeClassnameTestApi.java | 2 +- .../java/org/openapitools/api/PetApi.java | 8 ++-- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../org/openapitools/api/AnotherFakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 16 ++++---- .../api/FakeClassnameTestApi.java | 2 +- .../java/org/openapitools/api/PetApi.java | 8 ++-- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../org/openapitools/api/AnotherFakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 12 +++--- .../api/FakeClassnameTags123Api.java | 2 +- .../java/org/openapitools/api/PetApi.java | 12 +++--- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../java/org/openapitools/api/PetApi.java | 12 +++--- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../java/org/openapitools/api/PetApi.java | 12 +++--- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../java/org/openapitools/api/PetApi.java | 12 +++--- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../java/org/openapitools/api/PetApi.java | 12 +++--- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../java/org/openapitools/api/PetApi.java | 2 +- .../org/openapitools/api/AnotherFakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 12 +++--- .../api/FakeClassnameTags123Api.java | 2 +- .../java/org/openapitools/api/PetApi.java | 12 +++--- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../java/org/openapitools/api/PetApi.java | 10 ++--- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../java/org/openapitools/api/PetApi.java | 12 +++--- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../java/org/openapitools/api/PetApi.java | 12 +++--- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../java/org/openapitools/api/PetApi.java | 12 +++--- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../java/org/openapitools/api/BarApi.java | 2 +- .../java/org/openapitools/api/FooApi.java | 4 +- .../java/org/openapitools/api/AnimalsApi.java | 2 +- .../org/openapitools/api/BeveragesApi.java | 2 +- .../java/org/openapitools/api/FruitsApi.java | 2 +- .../java/org/openapitools/api/BarApi.java | 2 +- .../java/org/openapitools/api/FooApi.java | 4 +- .../java/org/openapitools/api/BarApi.java | 2 +- .../java/org/openapitools/api/FooApi.java | 4 +- .../java/org/openapitools/api/PetApi.java | 12 +++--- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../java/org/openapitools/api/PetApi.java | 12 +++--- .../org/openapitools/api/PetApiDelegate.java | 12 +++--- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../openapitools/api/StoreApiDelegate.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../org/openapitools/api/UserApiDelegate.java | 4 +- .../java/org/openapitools/api/PetApi.java | 12 +++--- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../java/org/openapitools/api/FileApi.java | 2 +- .../java/org/openapitools/api/FooApi.java | 2 +- .../api/RequiredAndNullableApi.java | 2 +- .../java/org/openapitools/api/FileApi.java | 2 +- .../java/org/openapitools/api/FooApi.java | 2 +- .../api/RequiredAndNullableApi.java | 2 +- .../java/org/openapitools/api/FileApi.java | 2 +- .../java/org/openapitools/api/FooApi.java | 2 +- .../api/RequiredAndNullableApi.java | 2 +- .../java/org/openapitools/api/PetApi.java | 12 +++--- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../org/openapitools/api/AnotherFakeApi.java | 2 +- .../api/AnotherFakeApiDelegate.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 16 ++++---- .../org/openapitools/api/FakeApiDelegate.java | 16 ++++---- .../api/FakeClassnameTestApi.java | 2 +- .../api/FakeClassnameTestApiDelegate.java | 2 +- .../java/org/openapitools/api/PetApi.java | 8 ++-- .../org/openapitools/api/PetApiDelegate.java | 8 ++-- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../openapitools/api/StoreApiDelegate.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../org/openapitools/api/UserApiDelegate.java | 4 +- .../org/openapitools/api/AnotherFakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 16 ++++---- .../api/FakeClassnameTestApi.java | 2 +- .../java/org/openapitools/api/PetApi.java | 8 ++-- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../java/org/openapitools/api/PetApi.java | 12 +++--- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../java/org/openapitools/api/PetApi.java | 12 +++--- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../org/openapitools/api/AnotherFakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 16 ++++---- .../api/FakeClassnameTestApi.java | 2 +- .../java/org/openapitools/api/PetApi.java | 8 ++-- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../java/org/openapitools/api/DogsApi.java | 2 +- .../org/openapitools/api/DogsApiDelegate.java | 2 +- .../org/openapitools/api/AnotherFakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 16 ++++---- .../api/FakeClassnameTestApi.java | 2 +- .../java/org/openapitools/api/PetApi.java | 8 ++-- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../org/openapitools/api/AnotherFakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 16 ++++---- .../api/FakeClassnameTestApi.java | 2 +- .../java/org/openapitools/api/PetApi.java | 8 ++-- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../org/openapitools/api/AnotherFakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 16 ++++---- .../api/FakeClassnameTestApi.java | 2 +- .../java/org/openapitools/api/PetApi.java | 8 ++-- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../org/openapitools/api/AnotherFakeApi.java | 2 +- .../api/AnotherFakeApiDelegate.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 16 ++++---- .../org/openapitools/api/FakeApiDelegate.java | 16 ++++---- .../api/FakeClassnameTestApi.java | 2 +- .../api/FakeClassnameTestApiDelegate.java | 2 +- .../java/org/openapitools/api/PetApi.java | 8 ++-- .../org/openapitools/api/PetApiDelegate.java | 8 ++-- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../openapitools/api/StoreApiDelegate.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../org/openapitools/api/UserApiDelegate.java | 4 +- .../java/org/openapitools/api/PetApi.java | 12 +++--- .../org/openapitools/api/PetApiDelegate.java | 12 +++--- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../openapitools/api/StoreApiDelegate.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../org/openapitools/api/UserApiDelegate.java | 4 +- .../org/openapitools/api/AnotherFakeApi.java | 2 +- .../api/AnotherFakeApiDelegate.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 16 ++++---- .../org/openapitools/api/FakeApiDelegate.java | 16 ++++---- .../api/FakeClassnameTestApi.java | 2 +- .../api/FakeClassnameTestApiDelegate.java | 2 +- .../java/org/openapitools/api/PetApi.java | 8 ++-- .../org/openapitools/api/PetApiDelegate.java | 8 ++-- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../openapitools/api/StoreApiDelegate.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../org/openapitools/api/UserApiDelegate.java | 4 +- .../java/org/openapitools/api/PetApi.java | 12 +++--- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../org/openapitools/api/AnotherFakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 16 ++++---- .../api/FakeClassnameTestApi.java | 2 +- .../java/org/openapitools/api/PetApi.java | 8 ++-- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../org/openapitools/api/AnotherFakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 16 ++++---- .../api/FakeClassnameTestApi.java | 2 +- .../java/org/openapitools/api/PetApi.java | 8 ++-- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../java/org/openapitools/api/PetApi.java | 12 +++--- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../java/org/openapitools/api/PetApi.java | 12 +++--- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../java/org/openapitools/api/OrderApi.java | 2 +- .../java/org/openapitools/api/PetApi.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../java/org/openapitools/api/PetApi.java | 12 +++--- .../org/openapitools/api/PetApiDelegate.java | 12 +++--- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../openapitools/api/StoreApiDelegate.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../org/openapitools/api/UserApiDelegate.java | 4 +- .../org/openapitools/api/AnotherFakeApi.java | 2 +- .../api/AnotherFakeApiDelegate.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 16 ++++---- .../org/openapitools/api/FakeApiDelegate.java | 16 ++++---- .../api/FakeClassnameTestApi.java | 2 +- .../api/FakeClassnameTestApiDelegate.java | 2 +- .../java/org/openapitools/api/PetApi.java | 8 ++-- .../org/openapitools/api/PetApiDelegate.java | 8 ++-- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../openapitools/api/StoreApiDelegate.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../org/openapitools/api/UserApiDelegate.java | 4 +- .../org/openapitools/api/AnotherFakeApi.java | 2 +- .../api/AnotherFakeApiDelegate.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 16 ++++---- .../org/openapitools/api/FakeApiDelegate.java | 16 ++++---- .../api/FakeClassnameTestApi.java | 2 +- .../api/FakeClassnameTestApiDelegate.java | 2 +- .../java/org/openapitools/api/PetApi.java | 8 ++-- .../org/openapitools/api/PetApiDelegate.java | 8 ++-- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../openapitools/api/StoreApiDelegate.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../org/openapitools/api/UserApiDelegate.java | 4 +- .../java/org/openapitools/api/PetApi.java | 38 +++++++++---------- .../org/openapitools/api/AnotherFakeApi.java | 2 +- .../api/AnotherFakeApiDelegate.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 12 +++--- .../org/openapitools/api/FakeApiDelegate.java | 12 +++--- .../api/FakeClassnameTestApi.java | 2 +- .../api/FakeClassnameTestApiDelegate.java | 2 +- .../java/org/openapitools/api/PetApi.java | 10 ++--- .../org/openapitools/api/PetApiDelegate.java | 10 ++--- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../openapitools/api/StoreApiDelegate.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../org/openapitools/api/UserApiDelegate.java | 4 +- .../org/openapitools/api/VersioningApi.java | 6 +-- .../api/VersioningApiDelegate.java | 6 +-- .../org/openapitools/api/AnotherFakeApi.java | 2 +- .../api/AnotherFakeApiDelegate.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 12 +++--- .../org/openapitools/api/FakeApiDelegate.java | 12 +++--- .../api/FakeClassnameTestApi.java | 2 +- .../api/FakeClassnameTestApiDelegate.java | 2 +- .../java/org/openapitools/api/PetApi.java | 10 ++--- .../org/openapitools/api/PetApiDelegate.java | 10 ++--- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../openapitools/api/StoreApiDelegate.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../org/openapitools/api/UserApiDelegate.java | 4 +- .../org/openapitools/api/VersioningApi.java | 6 +-- .../api/VersioningApiDelegate.java | 6 +-- .../org/openapitools/api/AnotherFakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 12 +++--- .../api/FakeClassnameTestApi.java | 2 +- .../java/org/openapitools/api/PetApi.java | 10 ++--- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../org/openapitools/api/VersioningApi.java | 6 +-- .../org/openapitools/api/AnotherFakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 12 +++--- .../api/FakeClassnameTestApi.java | 2 +- .../java/org/openapitools/api/PetApi.java | 10 ++--- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../org/openapitools/api/VersioningApi.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 2 +- .../org/openapitools/api/AnotherFakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 16 ++++---- .../api/FakeClassnameTestApi.java | 2 +- .../java/org/openapitools/api/PetApi.java | 8 ++-- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../virtualan/api/AnotherFakeApi.java | 2 +- .../openapitools/virtualan/api/FakeApi.java | 16 ++++---- .../virtualan/api/FakeClassnameTestApi.java | 2 +- .../openapitools/virtualan/api/PetApi.java | 8 ++-- .../openapitools/virtualan/api/StoreApi.java | 6 +-- .../openapitools/virtualan/api/UserApi.java | 4 +- .../org/openapitools/api/AnotherFakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 18 ++++----- .../api/FakeClassnameTestApi.java | 2 +- .../java/org/openapitools/api/FooApi.java | 2 +- .../java/org/openapitools/api/PetApi.java | 8 ++-- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- .../org/openapitools/api/AnotherFakeApi.java | 2 +- .../java/org/openapitools/api/FakeApi.java | 16 ++++---- .../api/FakeClassnameTestApi.java | 2 +- .../java/org/openapitools/api/PetApi.java | 8 ++-- .../java/org/openapitools/api/StoreApi.java | 6 +-- .../java/org/openapitools/api/UserApi.java | 4 +- 303 files changed, 953 insertions(+), 953 deletions(-) diff --git a/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/api/PetApi.java index 674a6a340be4..2ab393a9d269 100644 --- a/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/api/PetApi.java @@ -128,7 +128,7 @@ ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/json", "application/xml" } ) - ResponseEntity> findPetsByStatus( + @Valid ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) List status ); @@ -166,7 +166,7 @@ ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/json", "application/xml" } ) - ResponseEntity> findPetsByTags( + @Valid ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) List tags ); @@ -203,7 +203,7 @@ ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/json", "application/xml" } ) - ResponseEntity getPetById( + @Valid ResponseEntity getPetById( @Parameter(name = "petId", deprecated = true, description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") @Deprecated Long petId ); @@ -306,7 +306,7 @@ ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = "multipart/form-data" ) - ResponseEntity uploadFile( + @Valid ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/api/StoreApi.java index 1cdf6764da35..bf0e1fcfa77f 100644 --- a/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/api/StoreApi.java @@ -90,7 +90,7 @@ ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - ResponseEntity> getInventory( + @Valid ResponseEntity> getInventory( ); @@ -124,7 +124,7 @@ ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/json", "application/xml" } ) - ResponseEntity getOrderById( + @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId ); @@ -157,7 +157,7 @@ ResponseEntity getOrderById( produces = { "application/json", "application/xml" }, consumes = "application/json" ) - ResponseEntity placeOrder( + @Valid ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ); diff --git a/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/api/UserApi.java index ef8686f0f943..5cf8b2d06f48 100644 --- a/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud-deprecated/src/main/java/org/openapitools/api/UserApi.java @@ -186,7 +186,7 @@ ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/json", "application/xml" } ) - ResponseEntity getUserByName( + @Valid ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ); @@ -219,7 +219,7 @@ ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/json", "application/xml" } ) - ResponseEntity loginUser( + @Valid ResponseEntity loginUser( @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", deprecated = true, description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) @Deprecated String password ); diff --git a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/PetApi.java index c9d80aebebbb..06aa62645f4d 100644 --- a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/PetApi.java @@ -68,7 +68,7 @@ public interface PetApi { produces = { "application/json", "application/xml" }, consumes = "application/json" ) - ResponseEntity addPet( + @Valid ResponseEntity addPet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ); @@ -134,7 +134,7 @@ ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/json", "application/xml" } ) - ResponseEntity> findPetsByStatus( + @Valid ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", deprecated = true, description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) @Deprecated List status ); @@ -172,7 +172,7 @@ ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/json", "application/xml" } ) - ResponseEntity> findPetsByTags( + @Valid ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) List tags ); @@ -209,7 +209,7 @@ ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/json", "application/xml" } ) - ResponseEntity getPetById( + @Valid ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ); @@ -252,7 +252,7 @@ ResponseEntity getPetById( produces = { "application/json", "application/xml" }, consumes = "application/json" ) - ResponseEntity updatePet( + @Valid ResponseEntity updatePet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ); @@ -321,7 +321,7 @@ ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = "multipart/form-data" ) - ResponseEntity uploadFile( + @Valid ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/StoreApi.java index 1cdf6764da35..bf0e1fcfa77f 100644 --- a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/StoreApi.java @@ -90,7 +90,7 @@ ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - ResponseEntity> getInventory( + @Valid ResponseEntity> getInventory( ); @@ -124,7 +124,7 @@ ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/json", "application/xml" } ) - ResponseEntity getOrderById( + @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId ); @@ -157,7 +157,7 @@ ResponseEntity getOrderById( produces = { "application/json", "application/xml" }, consumes = "application/json" ) - ResponseEntity placeOrder( + @Valid ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ); diff --git a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/UserApi.java index 54dd51c7bca2..299604d96921 100644 --- a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/api/UserApi.java @@ -186,7 +186,7 @@ ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/json", "application/xml" } ) - ResponseEntity getUserByName( + @Valid ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ); @@ -219,7 +219,7 @@ ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/json", "application/xml" } ) - ResponseEntity loginUser( + @Valid ResponseEntity loginUser( @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ); diff --git a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/PetController.java b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/PetController.java index 449ba403ef45..238e93e95e10 100644 --- a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/PetController.java +++ b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/PetController.java @@ -126,7 +126,7 @@ ResponseEntity deletePet( value = PetController.PATH_FIND_PETS_BY_STATUS, produces = { "application/json", "application/xml" } ) - ResponseEntity> findPetsByStatus( + @Valid ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) List status, @ParameterObject final Pageable pageable ); @@ -165,7 +165,7 @@ ResponseEntity> findPetsByStatus( value = PetController.PATH_FIND_PETS_BY_TAGS, produces = { "application/json", "application/xml" } ) - ResponseEntity> findPetsByTags( + @Valid ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) List tags, @ParameterObject final Pageable pageable ); @@ -203,7 +203,7 @@ ResponseEntity> findPetsByTags( value = PetController.PATH_GET_PET_BY_ID, produces = { "application/json", "application/xml" } ) - ResponseEntity getPetById( + @Valid ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ); @@ -300,7 +300,7 @@ ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = "multipart/form-data" ) - ResponseEntity uploadFile( + @Valid ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/StoreController.java b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/StoreController.java index c4ee8bb34aff..082f359c8a66 100644 --- a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/StoreController.java +++ b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/StoreController.java @@ -90,7 +90,7 @@ ResponseEntity deleteOrder( value = StoreController.PATH_GET_INVENTORY, produces = { "application/json" } ) - ResponseEntity> getInventory( + @Valid ResponseEntity> getInventory( ); @@ -124,7 +124,7 @@ ResponseEntity> getInventory( value = StoreController.PATH_GET_ORDER_BY_ID, produces = { "application/json", "application/xml" } ) - ResponseEntity getOrderById( + @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId ); @@ -154,7 +154,7 @@ ResponseEntity getOrderById( value = StoreController.PATH_PLACE_ORDER, produces = { "application/json", "application/xml" } ) - ResponseEntity placeOrder( + @Valid ResponseEntity placeOrder( @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body ); diff --git a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/UserController.java b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/UserController.java index bea2734b5eed..8303e6038388 100644 --- a/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/UserController.java +++ b/samples/client/petstore/spring-cloud-tags/src/main/java/org/openapitools/api/UserController.java @@ -165,7 +165,7 @@ ResponseEntity deleteUser( value = UserController.PATH_GET_USER_BY_NAME, produces = { "application/json", "application/xml" } ) - ResponseEntity getUserByName( + @Valid ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ); @@ -196,7 +196,7 @@ ResponseEntity getUserByName( value = UserController.PATH_LOGIN_USER, produces = { "application/json", "application/xml" } ) - ResponseEntity loginUser( + @Valid ResponseEntity loginUser( @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ); diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java index c9d80aebebbb..06aa62645f4d 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java @@ -68,7 +68,7 @@ public interface PetApi { produces = { "application/json", "application/xml" }, consumes = "application/json" ) - ResponseEntity addPet( + @Valid ResponseEntity addPet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ); @@ -134,7 +134,7 @@ ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/json", "application/xml" } ) - ResponseEntity> findPetsByStatus( + @Valid ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", deprecated = true, description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) @Deprecated List status ); @@ -172,7 +172,7 @@ ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/json", "application/xml" } ) - ResponseEntity> findPetsByTags( + @Valid ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) List tags ); @@ -209,7 +209,7 @@ ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/json", "application/xml" } ) - ResponseEntity getPetById( + @Valid ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ); @@ -252,7 +252,7 @@ ResponseEntity getPetById( produces = { "application/json", "application/xml" }, consumes = "application/json" ) - ResponseEntity updatePet( + @Valid ResponseEntity updatePet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ); @@ -321,7 +321,7 @@ ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = "multipart/form-data" ) - ResponseEntity uploadFile( + @Valid ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java index 1cdf6764da35..bf0e1fcfa77f 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java @@ -90,7 +90,7 @@ ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - ResponseEntity> getInventory( + @Valid ResponseEntity> getInventory( ); @@ -124,7 +124,7 @@ ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/json", "application/xml" } ) - ResponseEntity getOrderById( + @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId ); @@ -157,7 +157,7 @@ ResponseEntity getOrderById( produces = { "application/json", "application/xml" }, consumes = "application/json" ) - ResponseEntity placeOrder( + @Valid ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ); diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java index 54dd51c7bca2..299604d96921 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java @@ -186,7 +186,7 @@ ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/json", "application/xml" } ) - ResponseEntity getUserByName( + @Valid ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ); @@ -219,7 +219,7 @@ ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/json", "application/xml" } ) - ResponseEntity loginUser( + @Valid ResponseEntity loginUser( @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ); diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/AnotherFakeApi.java index a2a14fb92356..ba9920c798ed 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -38,7 +38,7 @@ public interface AnotherFakeApi { accept = { "application/json" }, contentType = "application/json" ) - ResponseEntity call123testSpecialTags( + @Valid ResponseEntity call123testSpecialTags( @Valid @RequestBody ClientDto clientDto ); diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/FakeApi.java index 7da03d3ea45d..678f80eb157c 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/FakeApi.java @@ -70,7 +70,7 @@ ResponseEntity createXmlItem( accept = { "*/*" }, contentType = "application/json" ) - ResponseEntity fakeOuterBooleanSerialize( + @Valid ResponseEntity fakeOuterBooleanSerialize( @Valid @RequestBody(required = false) @Nullable Boolean body ); @@ -89,7 +89,7 @@ ResponseEntity fakeOuterBooleanSerialize( accept = { "*/*" }, contentType = "application/json" ) - ResponseEntity fakeOuterCompositeSerialize( + @Valid ResponseEntity fakeOuterCompositeSerialize( @Valid @RequestBody(required = false) @Nullable OuterCompositeDto outerCompositeDto ); @@ -108,7 +108,7 @@ ResponseEntity fakeOuterCompositeSerialize( accept = { "*/*" }, contentType = "application/json" ) - ResponseEntity fakeOuterNumberSerialize( + @Valid ResponseEntity fakeOuterNumberSerialize( @Valid @RequestBody(required = false) @Nullable BigDecimal body ); @@ -127,7 +127,7 @@ ResponseEntity fakeOuterNumberSerialize( accept = { "*/*" }, contentType = "application/json" ) - ResponseEntity fakeOuterStringSerialize( + @Valid ResponseEntity fakeOuterStringSerialize( @Valid @RequestBody(required = false) @Nullable String body ); @@ -144,7 +144,7 @@ ResponseEntity fakeOuterStringSerialize( value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, accept = { "application/json" } ) - ResponseEntity responseObjectDifferentNames( + @Valid ResponseEntity responseObjectDifferentNames( @PathVariable("petId") Long petId ); @@ -202,7 +202,7 @@ ResponseEntity testBodyWithQueryParams( accept = { "application/json" }, contentType = "application/json" ) - ResponseEntity testClientModel( + @Valid ResponseEntity testClientModel( @Valid @RequestBody ClientDto clientDto ); @@ -410,7 +410,7 @@ ResponseEntity testQueryParameterCollectionFormat( value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, accept = { "application/json" } ) - ResponseEntity testWithResultExample( + @Valid ResponseEntity testWithResultExample( ); @@ -431,7 +431,7 @@ ResponseEntity testWithResultExample( accept = { "application/json" }, contentType = "multipart/form-data" ) - ResponseEntity uploadFileWithRequiredFile( + @Valid ResponseEntity uploadFileWithRequiredFile( @PathVariable("petId") Long petId, @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 0f3e126aab65..6b99b7036c4c 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -38,7 +38,7 @@ public interface FakeClassnameTestApi { accept = { "application/json" }, contentType = "application/json" ) - ResponseEntity testClassname( + @Valid ResponseEntity testClassname( @Valid @RequestBody ClientDto clientDto ); diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/PetApi.java index 8fe8989f3628..c369f1540678 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/PetApi.java @@ -82,7 +82,7 @@ ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, accept = { "application/json", "application/xml" } ) - ResponseEntity> findPetsByStatus( + @Valid ResponseEntity> findPetsByStatus( @NotNull @RequestParam(value = "status", required = true) List status ); @@ -103,7 +103,7 @@ ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, accept = { "application/json", "application/xml" } ) - ResponseEntity> findPetsByTags( + @Valid ResponseEntity> findPetsByTags( @NotNull @RequestParam(value = "tags", required = true) Set tags ); @@ -123,7 +123,7 @@ ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, accept = { "application/json", "application/xml" } ) - ResponseEntity getPetById( + @Valid ResponseEntity getPetById( @PathVariable("petId") Long petId ); @@ -189,7 +189,7 @@ ResponseEntity updatePetWithForm( accept = { "application/json" }, contentType = "multipart/form-data" ) - ResponseEntity uploadFile( + @Valid ResponseEntity uploadFile( @PathVariable("petId") Long petId, @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/StoreApi.java index e87c9c4f5664..4cc75f794bbc 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/StoreApi.java @@ -56,7 +56,7 @@ ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, accept = { "application/json" } ) - ResponseEntity> getInventory( + @Valid ResponseEntity> getInventory( ); @@ -76,7 +76,7 @@ ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, accept = { "application/json", "application/xml" } ) - ResponseEntity getOrderById( + @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @PathVariable("order_id") Long orderId ); @@ -96,7 +96,7 @@ ResponseEntity getOrderById( accept = { "application/json", "application/xml" }, contentType = "application/json" ) - ResponseEntity placeOrder( + @Valid ResponseEntity placeOrder( @Valid @RequestBody OrderDto orderDto ); diff --git a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/UserApi.java index 218f93b1ee3e..4f502789b384 100644 --- a/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-http-interface-bean-validation/src/main/java/org/openapitools/api/UserApi.java @@ -116,7 +116,7 @@ ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, accept = { "application/json", "application/xml" } ) - ResponseEntity getUserByName( + @Valid ResponseEntity getUserByName( @PathVariable("username") String username ); @@ -136,7 +136,7 @@ ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, accept = { "application/json", "application/xml" } ) - ResponseEntity loginUser( + @Valid ResponseEntity loginUser( @NotNull @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Valid @RequestParam(value = "password", required = true) String password ); diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/AnotherFakeApi.java index f88e256362da..745660615e40 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -42,7 +42,7 @@ public interface AnotherFakeApi { accept = { "application/json" }, contentType = "application/json" ) - Mono> call123testSpecialTags( + @Valid Mono> call123testSpecialTags( @Valid @RequestBody Mono client ); diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/FakeApi.java index 91e442a92abd..ba2dc69c84d7 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/FakeApi.java @@ -74,7 +74,7 @@ Mono> createXmlItem( accept = { "*/*" }, contentType = "application/json" ) - Mono> fakeOuterBooleanSerialize( + @Valid Mono> fakeOuterBooleanSerialize( @Valid @RequestBody(required = false) Mono body ); @@ -93,7 +93,7 @@ Mono> fakeOuterBooleanSerialize( accept = { "*/*" }, contentType = "application/json" ) - Mono> fakeOuterCompositeSerialize( + @Valid Mono> fakeOuterCompositeSerialize( @Valid @RequestBody(required = false) Mono outerComposite ); @@ -112,7 +112,7 @@ Mono> fakeOuterCompositeSerialize( accept = { "*/*" }, contentType = "application/json" ) - Mono> fakeOuterNumberSerialize( + @Valid Mono> fakeOuterNumberSerialize( @Valid @RequestBody(required = false) Mono body ); @@ -131,7 +131,7 @@ Mono> fakeOuterNumberSerialize( accept = { "*/*" }, contentType = "application/json" ) - Mono> fakeOuterStringSerialize( + @Valid Mono> fakeOuterStringSerialize( @Valid @RequestBody(required = false) Mono body ); @@ -148,7 +148,7 @@ Mono> fakeOuterStringSerialize( value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, accept = { "application/json" } ) - Mono> responseObjectDifferentNames( + @Valid Mono> responseObjectDifferentNames( @PathVariable("petId") Long petId ); @@ -206,7 +206,7 @@ Mono> testBodyWithQueryParams( accept = { "application/json" }, contentType = "application/json" ) - Mono> testClientModel( + @Valid Mono> testClientModel( @Valid @RequestBody Mono client ); @@ -414,7 +414,7 @@ Mono> testQueryParameterCollectionFormat( value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, accept = { "application/json" } ) - Mono> testWithResultExample( + @Valid Mono> testWithResultExample( ); @@ -435,7 +435,7 @@ Mono> testWithResultExample( accept = { "application/json" }, contentType = "multipart/form-data" ) - Mono> uploadFileWithRequiredFile( + @Valid Mono> uploadFileWithRequiredFile( @PathVariable("petId") Long petId, @RequestPart(value = "requiredFile", required = true) Part requiredFile, @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index d1617b196a44..224036e178f9 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -42,7 +42,7 @@ public interface FakeClassnameTestApi { accept = { "application/json" }, contentType = "application/json" ) - Mono> testClassname( + @Valid Mono> testClassname( @Valid @RequestBody Mono client ); diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/PetApi.java index 77eefc419be2..7c21e1822a44 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/PetApi.java @@ -86,7 +86,7 @@ Mono> deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, accept = { "application/json", "application/xml" } ) - Mono>> findPetsByStatus( + @Valid Mono>> findPetsByStatus( @NotNull @RequestParam(value = "status", required = true) List status ); @@ -107,7 +107,7 @@ Mono>> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, accept = { "application/json", "application/xml" } ) - Mono>> findPetsByTags( + @Valid Mono>> findPetsByTags( @NotNull @RequestParam(value = "tags", required = true) Set tags ); @@ -127,7 +127,7 @@ Mono>> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, accept = { "application/json", "application/xml" } ) - Mono> getPetById( + @Valid Mono> getPetById( @PathVariable("petId") Long petId ); @@ -193,7 +193,7 @@ Mono> updatePetWithForm( accept = { "application/json" }, contentType = "multipart/form-data" ) - Mono> uploadFile( + @Valid Mono> uploadFile( @PathVariable("petId") Long petId, @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, @RequestPart(value = "file", required = false) Part file diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/StoreApi.java index c5d77d56359d..9679b959383a 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/StoreApi.java @@ -60,7 +60,7 @@ Mono> deleteOrder( value = StoreApi.PATH_GET_INVENTORY, accept = { "application/json" } ) - Mono>> getInventory( + @Valid Mono>> getInventory( ); @@ -80,7 +80,7 @@ Mono>> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, accept = { "application/json", "application/xml" } ) - Mono> getOrderById( + @Valid Mono> getOrderById( @Min(value = 1L) @Max(value = 5L) @PathVariable("order_id") Long orderId ); @@ -100,7 +100,7 @@ Mono> getOrderById( accept = { "application/json", "application/xml" }, contentType = "application/json" ) - Mono> placeOrder( + @Valid Mono> placeOrder( @Valid @RequestBody Mono order ); diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/UserApi.java index b97b6b4c7ba3..8f185971319b 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/UserApi.java @@ -120,7 +120,7 @@ Mono> deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, accept = { "application/json", "application/xml" } ) - Mono> getUserByName( + @Valid Mono> getUserByName( @PathVariable("username") String username ); @@ -140,7 +140,7 @@ Mono> getUserByName( value = UserApi.PATH_LOGIN_USER, accept = { "application/json", "application/xml" } ) - Mono> loginUser( + @Valid Mono> loginUser( @NotNull @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Valid @RequestParam(value = "password", required = true) String password ); diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/AnotherFakeApi.java index a2a14fb92356..ba9920c798ed 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -38,7 +38,7 @@ public interface AnotherFakeApi { accept = { "application/json" }, contentType = "application/json" ) - ResponseEntity call123testSpecialTags( + @Valid ResponseEntity call123testSpecialTags( @Valid @RequestBody ClientDto clientDto ); diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/FakeApi.java index 7da03d3ea45d..678f80eb157c 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/FakeApi.java @@ -70,7 +70,7 @@ ResponseEntity createXmlItem( accept = { "*/*" }, contentType = "application/json" ) - ResponseEntity fakeOuterBooleanSerialize( + @Valid ResponseEntity fakeOuterBooleanSerialize( @Valid @RequestBody(required = false) @Nullable Boolean body ); @@ -89,7 +89,7 @@ ResponseEntity fakeOuterBooleanSerialize( accept = { "*/*" }, contentType = "application/json" ) - ResponseEntity fakeOuterCompositeSerialize( + @Valid ResponseEntity fakeOuterCompositeSerialize( @Valid @RequestBody(required = false) @Nullable OuterCompositeDto outerCompositeDto ); @@ -108,7 +108,7 @@ ResponseEntity fakeOuterCompositeSerialize( accept = { "*/*" }, contentType = "application/json" ) - ResponseEntity fakeOuterNumberSerialize( + @Valid ResponseEntity fakeOuterNumberSerialize( @Valid @RequestBody(required = false) @Nullable BigDecimal body ); @@ -127,7 +127,7 @@ ResponseEntity fakeOuterNumberSerialize( accept = { "*/*" }, contentType = "application/json" ) - ResponseEntity fakeOuterStringSerialize( + @Valid ResponseEntity fakeOuterStringSerialize( @Valid @RequestBody(required = false) @Nullable String body ); @@ -144,7 +144,7 @@ ResponseEntity fakeOuterStringSerialize( value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, accept = { "application/json" } ) - ResponseEntity responseObjectDifferentNames( + @Valid ResponseEntity responseObjectDifferentNames( @PathVariable("petId") Long petId ); @@ -202,7 +202,7 @@ ResponseEntity testBodyWithQueryParams( accept = { "application/json" }, contentType = "application/json" ) - ResponseEntity testClientModel( + @Valid ResponseEntity testClientModel( @Valid @RequestBody ClientDto clientDto ); @@ -410,7 +410,7 @@ ResponseEntity testQueryParameterCollectionFormat( value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, accept = { "application/json" } ) - ResponseEntity testWithResultExample( + @Valid ResponseEntity testWithResultExample( ); @@ -431,7 +431,7 @@ ResponseEntity testWithResultExample( accept = { "application/json" }, contentType = "multipart/form-data" ) - ResponseEntity uploadFileWithRequiredFile( + @Valid ResponseEntity uploadFileWithRequiredFile( @PathVariable("petId") Long petId, @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 0f3e126aab65..6b99b7036c4c 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -38,7 +38,7 @@ public interface FakeClassnameTestApi { accept = { "application/json" }, contentType = "application/json" ) - ResponseEntity testClassname( + @Valid ResponseEntity testClassname( @Valid @RequestBody ClientDto clientDto ); diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/PetApi.java index 8fe8989f3628..c369f1540678 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/PetApi.java @@ -82,7 +82,7 @@ ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, accept = { "application/json", "application/xml" } ) - ResponseEntity> findPetsByStatus( + @Valid ResponseEntity> findPetsByStatus( @NotNull @RequestParam(value = "status", required = true) List status ); @@ -103,7 +103,7 @@ ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, accept = { "application/json", "application/xml" } ) - ResponseEntity> findPetsByTags( + @Valid ResponseEntity> findPetsByTags( @NotNull @RequestParam(value = "tags", required = true) Set tags ); @@ -123,7 +123,7 @@ ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, accept = { "application/json", "application/xml" } ) - ResponseEntity getPetById( + @Valid ResponseEntity getPetById( @PathVariable("petId") Long petId ); @@ -189,7 +189,7 @@ ResponseEntity updatePetWithForm( accept = { "application/json" }, contentType = "multipart/form-data" ) - ResponseEntity uploadFile( + @Valid ResponseEntity uploadFile( @PathVariable("petId") Long petId, @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/StoreApi.java index e87c9c4f5664..4cc75f794bbc 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/StoreApi.java @@ -56,7 +56,7 @@ ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, accept = { "application/json" } ) - ResponseEntity> getInventory( + @Valid ResponseEntity> getInventory( ); @@ -76,7 +76,7 @@ ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, accept = { "application/json", "application/xml" } ) - ResponseEntity getOrderById( + @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @PathVariable("order_id") Long orderId ); @@ -96,7 +96,7 @@ ResponseEntity getOrderById( accept = { "application/json", "application/xml" }, contentType = "application/json" ) - ResponseEntity placeOrder( + @Valid ResponseEntity placeOrder( @Valid @RequestBody OrderDto orderDto ); diff --git a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/UserApi.java index 218f93b1ee3e..4f502789b384 100644 --- a/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-http-interface-springboot-4/src/main/java/org/openapitools/api/UserApi.java @@ -116,7 +116,7 @@ ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, accept = { "application/json", "application/xml" } ) - ResponseEntity getUserByName( + @Valid ResponseEntity getUserByName( @PathVariable("username") String username ); @@ -136,7 +136,7 @@ ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, accept = { "application/json", "application/xml" } ) - ResponseEntity loginUser( + @Valid ResponseEntity loginUser( @NotNull @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Valid @RequestParam(value = "password", required = true) String password ); diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/AnotherFakeApi.java index 5d05ce315711..b18e69850785 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -38,7 +38,7 @@ public interface AnotherFakeApi { accept = { "application/json" }, contentType = "application/json" ) - ResponseEntity call123testSpecialTags( + @Valid ResponseEntity call123testSpecialTags( @Valid @RequestBody Client client ); diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/FakeApi.java index a94e4191cbde..d9a92f766bb7 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/FakeApi.java @@ -68,7 +68,7 @@ ResponseEntity createXmlItem( accept = { "*/*" }, contentType = "application/json" ) - ResponseEntity fakeOuterBooleanSerialize( + @Valid ResponseEntity fakeOuterBooleanSerialize( @Valid @RequestBody(required = false) @Nullable Boolean body ); @@ -87,7 +87,7 @@ ResponseEntity fakeOuterBooleanSerialize( accept = { "*/*" }, contentType = "application/json" ) - ResponseEntity fakeOuterCompositeSerialize( + @Valid ResponseEntity fakeOuterCompositeSerialize( @Valid @RequestBody(required = false) @Nullable OuterComposite outerComposite ); @@ -106,7 +106,7 @@ ResponseEntity fakeOuterCompositeSerialize( accept = { "*/*" }, contentType = "application/json" ) - ResponseEntity fakeOuterNumberSerialize( + @Valid ResponseEntity fakeOuterNumberSerialize( @Valid @RequestBody(required = false) @Nullable BigDecimal body ); @@ -125,7 +125,7 @@ ResponseEntity fakeOuterNumberSerialize( accept = { "*/*" }, contentType = "application/json" ) - ResponseEntity fakeOuterStringSerialize( + @Valid ResponseEntity fakeOuterStringSerialize( @Valid @RequestBody(required = false) @Nullable String body ); @@ -183,7 +183,7 @@ ResponseEntity testBodyWithQueryParams( accept = { "application/json" }, contentType = "application/json" ) - ResponseEntity testClientModel( + @Valid ResponseEntity testClientModel( @Valid @RequestBody Client client ); @@ -391,7 +391,7 @@ ResponseEntity testQueryParameterCollectionFormat( value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, accept = { "application/json" } ) - ResponseEntity testWithResultExample( + @Valid ResponseEntity testWithResultExample( ); diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java index a669fd29ea43..52d2d76a3df2 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java @@ -38,7 +38,7 @@ public interface FakeClassnameTags123Api { accept = { "application/json" }, contentType = "application/json" ) - ResponseEntity testClassname( + @Valid ResponseEntity testClassname( @Valid @RequestBody Client client ); diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/PetApi.java index 7395e6a204d5..29602ef2c7b5 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/PetApi.java @@ -83,7 +83,7 @@ ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, accept = { "application/json", "application/xml" } ) - ResponseEntity> findPetsByStatus( + @Valid ResponseEntity> findPetsByStatus( @NotNull @RequestParam(value = "status", required = true) List status ); @@ -104,7 +104,7 @@ ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, accept = { "application/json", "application/xml" } ) - ResponseEntity> findPetsByTags( + @Valid ResponseEntity> findPetsByTags( @NotNull @RequestParam(value = "tags", required = true) Set tags ); @@ -124,7 +124,7 @@ ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, accept = { "application/json", "application/xml" } ) - ResponseEntity getPetById( + @Valid ResponseEntity getPetById( @PathVariable("petId") Long petId ); @@ -141,7 +141,7 @@ ResponseEntity getPetById( value = PetApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, accept = { "application/json" } ) - ResponseEntity responseObjectDifferentNames( + @Valid ResponseEntity responseObjectDifferentNames( @PathVariable("petId") Long petId ); @@ -207,7 +207,7 @@ ResponseEntity updatePetWithForm( accept = { "application/json" }, contentType = "multipart/form-data" ) - ResponseEntity uploadFile( + @Valid ResponseEntity uploadFile( @PathVariable("petId") Long petId, @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @RequestPart(value = "file", required = false) MultipartFile file @@ -230,7 +230,7 @@ ResponseEntity uploadFile( accept = { "application/json" }, contentType = "multipart/form-data" ) - ResponseEntity uploadFileWithRequiredFile( + @Valid ResponseEntity uploadFileWithRequiredFile( @PathVariable("petId") Long petId, @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/StoreApi.java index 6084c91fd568..4229495688d2 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/StoreApi.java @@ -56,7 +56,7 @@ ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, accept = { "application/json" } ) - ResponseEntity> getInventory( + @Valid ResponseEntity> getInventory( ); @@ -76,7 +76,7 @@ ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, accept = { "application/json", "application/xml" } ) - ResponseEntity getOrderById( + @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @PathVariable("order_id") Long orderId ); @@ -96,7 +96,7 @@ ResponseEntity getOrderById( accept = { "application/json", "application/xml" }, contentType = "application/json" ) - ResponseEntity placeOrder( + @Valid ResponseEntity placeOrder( @Valid @RequestBody Order order ); diff --git a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/UserApi.java index c5695d3e41f0..856caef15428 100644 --- a/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/api/UserApi.java @@ -116,7 +116,7 @@ ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, accept = { "application/json", "application/xml" } ) - ResponseEntity getUserByName( + @Valid ResponseEntity getUserByName( @PathVariable("username") String username ); @@ -136,7 +136,7 @@ ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, accept = { "application/json", "application/xml" } ) - ResponseEntity loginUser( + @Valid ResponseEntity loginUser( @NotNull @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Valid @RequestParam(value = "password", required = true) String password ); diff --git a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/api/PetApi.java index efe7ef845fae..3d78977e2eff 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/api/PetApi.java @@ -39,7 +39,7 @@ public interface PetApi { produces = { "application/json", "application/xml" }, consumes = "application/json" ) - ResponseEntity addPet( + @Valid ResponseEntity addPet( @Valid @RequestBody Pet pet ); @@ -77,7 +77,7 @@ ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/json", "application/xml" } ) - ResponseEntity> findPetsByStatus( + @Valid ResponseEntity> findPetsByStatus( @NotNull @RequestParam(value = "status", required = true) @Deprecated List status ); @@ -98,7 +98,7 @@ ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/json", "application/xml" } ) - ResponseEntity> findPetsByTags( + @Valid ResponseEntity> findPetsByTags( @NotNull @RequestParam(value = "tags", required = true) List tags ); @@ -118,7 +118,7 @@ ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/json", "application/xml" } ) - ResponseEntity getPetById( + @Valid ResponseEntity getPetById( @PathVariable("petId") Long petId ); @@ -142,7 +142,7 @@ ResponseEntity getPetById( produces = { "application/json", "application/xml" }, consumes = "application/json" ) - ResponseEntity updatePet( + @Valid ResponseEntity updatePet( @Valid @RequestBody Pet pet ); @@ -185,7 +185,7 @@ ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = "multipart/form-data" ) - ResponseEntity uploadFile( + @Valid ResponseEntity uploadFile( @PathVariable("petId") Long petId, @RequestParam(value = "additionalMetadata", required = false) Optional additionalMetadata, @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/api/StoreApi.java index 51b058a00a50..aa225a203f97 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/api/StoreApi.java @@ -53,7 +53,7 @@ ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - ResponseEntity> getInventory( + @Valid ResponseEntity> getInventory( ); @@ -73,7 +73,7 @@ ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/json", "application/xml" } ) - ResponseEntity getOrderById( + @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @PathVariable("orderId") Long orderId ); @@ -93,7 +93,7 @@ ResponseEntity getOrderById( produces = { "application/json", "application/xml" }, consumes = "application/json" ) - ResponseEntity placeOrder( + @Valid ResponseEntity placeOrder( @Valid @RequestBody Order order ); diff --git a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/api/UserApi.java index e363b175e49b..e3e4197a5727 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-3-with-optional/src/main/java/org/openapitools/api/UserApi.java @@ -110,7 +110,7 @@ ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/json", "application/xml" } ) - ResponseEntity getUserByName( + @Valid ResponseEntity getUserByName( @PathVariable("username") String username ); @@ -130,7 +130,7 @@ ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/json", "application/xml" } ) - ResponseEntity loginUser( + @Valid ResponseEntity loginUser( @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Valid @RequestParam(value = "password", required = true) String password ); diff --git a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/PetApi.java index c9d80aebebbb..06aa62645f4d 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/PetApi.java @@ -68,7 +68,7 @@ public interface PetApi { produces = { "application/json", "application/xml" }, consumes = "application/json" ) - ResponseEntity addPet( + @Valid ResponseEntity addPet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ); @@ -134,7 +134,7 @@ ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/json", "application/xml" } ) - ResponseEntity> findPetsByStatus( + @Valid ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", deprecated = true, description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) @Deprecated List status ); @@ -172,7 +172,7 @@ ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/json", "application/xml" } ) - ResponseEntity> findPetsByTags( + @Valid ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) List tags ); @@ -209,7 +209,7 @@ ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/json", "application/xml" } ) - ResponseEntity getPetById( + @Valid ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ); @@ -252,7 +252,7 @@ ResponseEntity getPetById( produces = { "application/json", "application/xml" }, consumes = "application/json" ) - ResponseEntity updatePet( + @Valid ResponseEntity updatePet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ); @@ -321,7 +321,7 @@ ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = "multipart/form-data" ) - ResponseEntity uploadFile( + @Valid ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/StoreApi.java index 1cdf6764da35..bf0e1fcfa77f 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/StoreApi.java @@ -90,7 +90,7 @@ ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - ResponseEntity> getInventory( + @Valid ResponseEntity> getInventory( ); @@ -124,7 +124,7 @@ ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/json", "application/xml" } ) - ResponseEntity getOrderById( + @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId ); @@ -157,7 +157,7 @@ ResponseEntity getOrderById( produces = { "application/json", "application/xml" }, consumes = "application/json" ) - ResponseEntity placeOrder( + @Valid ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ); diff --git a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/UserApi.java index 54dd51c7bca2..299604d96921 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/api/UserApi.java @@ -186,7 +186,7 @@ ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/json", "application/xml" } ) - ResponseEntity getUserByName( + @Valid ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ); @@ -219,7 +219,7 @@ ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/json", "application/xml" } ) - ResponseEntity loginUser( + @Valid ResponseEntity loginUser( @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ); diff --git a/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/api/PetApi.java index efe7ef845fae..3d78977e2eff 100644 --- a/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/api/PetApi.java @@ -39,7 +39,7 @@ public interface PetApi { produces = { "application/json", "application/xml" }, consumes = "application/json" ) - ResponseEntity addPet( + @Valid ResponseEntity addPet( @Valid @RequestBody Pet pet ); @@ -77,7 +77,7 @@ ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/json", "application/xml" } ) - ResponseEntity> findPetsByStatus( + @Valid ResponseEntity> findPetsByStatus( @NotNull @RequestParam(value = "status", required = true) @Deprecated List status ); @@ -98,7 +98,7 @@ ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/json", "application/xml" } ) - ResponseEntity> findPetsByTags( + @Valid ResponseEntity> findPetsByTags( @NotNull @RequestParam(value = "tags", required = true) List tags ); @@ -118,7 +118,7 @@ ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/json", "application/xml" } ) - ResponseEntity getPetById( + @Valid ResponseEntity getPetById( @PathVariable("petId") Long petId ); @@ -142,7 +142,7 @@ ResponseEntity getPetById( produces = { "application/json", "application/xml" }, consumes = "application/json" ) - ResponseEntity updatePet( + @Valid ResponseEntity updatePet( @Valid @RequestBody Pet pet ); @@ -185,7 +185,7 @@ ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = "multipart/form-data" ) - ResponseEntity uploadFile( + @Valid ResponseEntity uploadFile( @PathVariable("petId") Long petId, @RequestParam(value = "additionalMetadata", required = false) Optional additionalMetadata, @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/api/StoreApi.java index 51b058a00a50..aa225a203f97 100644 --- a/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/api/StoreApi.java @@ -53,7 +53,7 @@ ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - ResponseEntity> getInventory( + @Valid ResponseEntity> getInventory( ); @@ -73,7 +73,7 @@ ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/json", "application/xml" } ) - ResponseEntity getOrderById( + @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @PathVariable("orderId") Long orderId ); @@ -93,7 +93,7 @@ ResponseEntity getOrderById( produces = { "application/json", "application/xml" }, consumes = "application/json" ) - ResponseEntity placeOrder( + @Valid ResponseEntity placeOrder( @Valid @RequestBody Order order ); diff --git a/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/api/UserApi.java index e363b175e49b..e3e4197a5727 100644 --- a/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-4-with-optional/src/main/java/org/openapitools/api/UserApi.java @@ -110,7 +110,7 @@ ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/json", "application/xml" } ) - ResponseEntity getUserByName( + @Valid ResponseEntity getUserByName( @PathVariable("username") String username ); @@ -130,7 +130,7 @@ ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/json", "application/xml" } ) - ResponseEntity loginUser( + @Valid ResponseEntity loginUser( @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Valid @RequestParam(value = "password", required = true) String password ); diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java index 063cc2bd04b1..90e9d91822e8 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/PetApi.java @@ -69,7 +69,7 @@ public interface PetApi { produces = { "application/json", "application/xml" }, consumes = "application/json" ) - CompletableFuture> addPet( + @Valid CompletableFuture> addPet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ); @@ -135,7 +135,7 @@ CompletableFuture> deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/json", "application/xml" } ) - CompletableFuture>> findPetsByStatus( + @Valid CompletableFuture>> findPetsByStatus( @NotNull @Parameter(name = "status", deprecated = true, description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) @Deprecated List status ); @@ -173,7 +173,7 @@ CompletableFuture>> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/json", "application/xml" } ) - CompletableFuture>> findPetsByTags( + @Valid CompletableFuture>> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) List tags ); @@ -210,7 +210,7 @@ CompletableFuture>> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/json", "application/xml" } ) - CompletableFuture> getPetById( + @Valid CompletableFuture> getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ); @@ -253,7 +253,7 @@ CompletableFuture> getPetById( produces = { "application/json", "application/xml" }, consumes = "application/json" ) - CompletableFuture> updatePet( + @Valid CompletableFuture> updatePet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ); @@ -322,7 +322,7 @@ CompletableFuture> updatePetWithForm( produces = { "application/json" }, consumes = "multipart/form-data" ) - CompletableFuture> uploadFile( + @Valid CompletableFuture> uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java index 68765532836a..edcc6738da5f 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/StoreApi.java @@ -91,7 +91,7 @@ CompletableFuture> deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - CompletableFuture>> getInventory( + @Valid CompletableFuture>> getInventory( ); @@ -125,7 +125,7 @@ CompletableFuture>> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/json", "application/xml" } ) - CompletableFuture> getOrderById( + @Valid CompletableFuture> getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId ); @@ -158,7 +158,7 @@ CompletableFuture> getOrderById( produces = { "application/json", "application/xml" }, consumes = "application/json" ) - CompletableFuture> placeOrder( + @Valid CompletableFuture> placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ); diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java index d0dcda28e82f..f4c7c96a7461 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/api/UserApi.java @@ -187,7 +187,7 @@ CompletableFuture> deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/json", "application/xml" } ) - CompletableFuture> getUserByName( + @Valid CompletableFuture> getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ); @@ -220,7 +220,7 @@ CompletableFuture> getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/json", "application/xml" } ) - CompletableFuture> loginUser( + @Valid CompletableFuture> loginUser( @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ); diff --git a/samples/openapi3/client/petstore/spring-cloud-http-basic/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-cloud-http-basic/src/main/java/org/openapitools/api/PetApi.java index 78a362e77244..4d447ea9c1e3 100644 --- a/samples/openapi3/client/petstore/spring-cloud-http-basic/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-http-basic/src/main/java/org/openapitools/api/PetApi.java @@ -66,7 +66,7 @@ public interface PetApi { produces = { "application/json", "application/xml" }, consumes = "application/json" ) - ResponseEntity addPet( + @Valid ResponseEntity addPet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/AnotherFakeApi.java index ef198969318f..6c87cad1c4c4 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -60,7 +60,7 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = "application/json" ) - ResponseEntity call123testSpecialTags( + @Valid ResponseEntity call123testSpecialTags( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java index 87745747ca80..959baa8048aa 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java @@ -97,7 +97,7 @@ ResponseEntity createXmlItem( produces = { "*/*" }, consumes = "application/json" ) - ResponseEntity fakeOuterBooleanSerialize( + @Valid ResponseEntity fakeOuterBooleanSerialize( @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) @Nullable Boolean body ); @@ -126,7 +126,7 @@ ResponseEntity fakeOuterBooleanSerialize( produces = { "*/*" }, consumes = "application/json" ) - ResponseEntity fakeOuterCompositeSerialize( + @Valid ResponseEntity fakeOuterCompositeSerialize( @Parameter(name = "OuterComposite", description = "Input composite as post body") @Valid @RequestBody(required = false) @Nullable OuterComposite outerComposite ); @@ -155,7 +155,7 @@ ResponseEntity fakeOuterCompositeSerialize( produces = { "*/*" }, consumes = "application/json" ) - ResponseEntity fakeOuterNumberSerialize( + @Valid ResponseEntity fakeOuterNumberSerialize( @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) @Nullable BigDecimal body ); @@ -184,7 +184,7 @@ ResponseEntity fakeOuterNumberSerialize( produces = { "*/*" }, consumes = "application/json" ) - ResponseEntity fakeOuterStringSerialize( + @Valid ResponseEntity fakeOuterStringSerialize( @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) @Nullable String body ); @@ -266,7 +266,7 @@ ResponseEntity testBodyWithQueryParams( produces = { "application/json" }, consumes = "application/json" ) - ResponseEntity testClientModel( + @Valid ResponseEntity testClientModel( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ); @@ -544,7 +544,7 @@ ResponseEntity testQueryParameterCollectionFormat( value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) - ResponseEntity testWithResultExample( + @Valid ResponseEntity testWithResultExample( ); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java index 0dd04842e851..61c8a1449ccc 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java @@ -63,7 +63,7 @@ public interface FakeClassnameTags123Api { produces = { "application/json" }, consumes = "application/json" ) - ResponseEntity testClassname( + @Valid ResponseEntity testClassname( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/PetApi.java index d0e88ece0e66..9a8a910cc038 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/PetApi.java @@ -134,7 +134,7 @@ ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/json", "application/xml" } ) - ResponseEntity> findPetsByStatus( + @Valid ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) List status ); @@ -172,7 +172,7 @@ ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/json", "application/xml" } ) - ResponseEntity> findPetsByTags( + @Valid ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) Set tags ); @@ -209,7 +209,7 @@ ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/json", "application/xml" } ) - ResponseEntity getPetById( + @Valid ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ); @@ -235,7 +235,7 @@ ResponseEntity getPetById( value = PetApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) - ResponseEntity responseObjectDifferentNames( + @Valid ResponseEntity responseObjectDifferentNames( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ); @@ -340,7 +340,7 @@ ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = "multipart/form-data" ) - ResponseEntity uploadFile( + @Valid ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file @@ -377,7 +377,7 @@ ResponseEntity uploadFile( produces = { "application/json" }, consumes = "multipart/form-data" ) - ResponseEntity uploadFileWithRequiredFile( + @Valid ResponseEntity uploadFileWithRequiredFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/StoreApi.java index 2c6af836c68d..3bfab2a346e3 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/StoreApi.java @@ -90,7 +90,7 @@ ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - ResponseEntity> getInventory( + @Valid ResponseEntity> getInventory( ); @@ -124,7 +124,7 @@ ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/json", "application/xml" } ) - ResponseEntity getOrderById( + @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("order_id") Long orderId ); @@ -157,7 +157,7 @@ ResponseEntity getOrderById( produces = { "application/json", "application/xml" }, consumes = "application/json" ) - ResponseEntity placeOrder( + @Valid ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ); diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/UserApi.java index 928836220214..6d186cbd7160 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/UserApi.java @@ -174,7 +174,7 @@ ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/json", "application/xml" } ) - ResponseEntity getUserByName( + @Valid ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ); @@ -207,7 +207,7 @@ ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/json", "application/xml" } ) - ResponseEntity loginUser( + @Valid ResponseEntity loginUser( @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ); diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java index f0a3c3a66bd6..d554fd098e52 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/PetApi.java @@ -131,7 +131,7 @@ ResponseEntity deletePet( ) @org.springframework.validation.annotation.Validated @org.springframework.security.access.prepost.PreAuthorize("hasRole('ADMIN')") - ResponseEntity> findPetsByStatus( + @Valid ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) List status, @ParameterObject final Pageable pageable ); @@ -171,7 +171,7 @@ ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/json", "application/xml" } ) - ResponseEntity> findPetsByTags( + @Valid ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) List tags, @Parameter(name = "size", description = "A test HeaderParam for issue #8315 - must NOT be removed when x-spring-paginated:true is used.", in = ParameterIn.HEADER) @RequestHeader(value = "size", required = false) @Nullable String size, @PageableDefault(page = 0, size = 20) @SortDefault.SortDefaults({@SortDefault(sort = {"id"}, direction = Sort.Direction.ASC)}) @ParameterObject final Pageable pageable @@ -210,7 +210,7 @@ ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/json", "application/xml" } ) - ResponseEntity getPetById( + @Valid ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ); @@ -245,7 +245,7 @@ ResponseEntity getPetById( produces = { "application/json", "application/xml" } ) @org.springframework.validation.annotation.Validated - ResponseEntity> listAllPets( + @Valid ResponseEntity> listAllPets( @PageableDefault(page = 0, size = 20) @ParameterObject final Pageable pageable ); @@ -342,7 +342,7 @@ ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = "multipart/form-data" ) - ResponseEntity uploadFile( + @Valid ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java index a2e0d04ebe75..c5d99b0cb8f8 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java @@ -90,7 +90,7 @@ ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - ResponseEntity> getInventory( + @Valid ResponseEntity> getInventory( ); @@ -124,7 +124,7 @@ ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/json", "application/xml" } ) - ResponseEntity getOrderById( + @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId ); @@ -154,7 +154,7 @@ ResponseEntity getOrderById( value = StoreApi.PATH_PLACE_ORDER, produces = { "application/json", "application/xml" } ) - ResponseEntity placeOrder( + @Valid ResponseEntity placeOrder( @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body ); diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java index cbb5f5dd3240..88f9ef4be72d 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/api/UserApi.java @@ -165,7 +165,7 @@ ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/json", "application/xml" } ) - ResponseEntity getUserByName( + @Valid ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ); @@ -196,7 +196,7 @@ ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/json", "application/xml" } ) - ResponseEntity loginUser( + @Valid ResponseEntity loginUser( @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ); diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java index c9d80aebebbb..06aa62645f4d 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/PetApi.java @@ -68,7 +68,7 @@ public interface PetApi { produces = { "application/json", "application/xml" }, consumes = "application/json" ) - ResponseEntity addPet( + @Valid ResponseEntity addPet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ); @@ -134,7 +134,7 @@ ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/json", "application/xml" } ) - ResponseEntity> findPetsByStatus( + @Valid ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", deprecated = true, description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) @Deprecated List status ); @@ -172,7 +172,7 @@ ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/json", "application/xml" } ) - ResponseEntity> findPetsByTags( + @Valid ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) List tags ); @@ -209,7 +209,7 @@ ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/json", "application/xml" } ) - ResponseEntity getPetById( + @Valid ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ); @@ -252,7 +252,7 @@ ResponseEntity getPetById( produces = { "application/json", "application/xml" }, consumes = "application/json" ) - ResponseEntity updatePet( + @Valid ResponseEntity updatePet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ); @@ -321,7 +321,7 @@ ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = "multipart/form-data" ) - ResponseEntity uploadFile( + @Valid ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java index 1cdf6764da35..bf0e1fcfa77f 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/StoreApi.java @@ -90,7 +90,7 @@ ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - ResponseEntity> getInventory( + @Valid ResponseEntity> getInventory( ); @@ -124,7 +124,7 @@ ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/json", "application/xml" } ) - ResponseEntity getOrderById( + @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId ); @@ -157,7 +157,7 @@ ResponseEntity getOrderById( produces = { "application/json", "application/xml" }, consumes = "application/json" ) - ResponseEntity placeOrder( + @Valid ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ); diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java index 54dd51c7bca2..299604d96921 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/api/UserApi.java @@ -186,7 +186,7 @@ ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/json", "application/xml" } ) - ResponseEntity getUserByName( + @Valid ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ); @@ -219,7 +219,7 @@ ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/json", "application/xml" } ) - ResponseEntity loginUser( + @Valid ResponseEntity loginUser( @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ); diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/PetApi.java index f670fc094473..e1e123f31c8f 100644 --- a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/PetApi.java @@ -68,7 +68,7 @@ public interface PetApi { produces = { "application/json", "application/xml" }, consumes = "application/json" ) - ResponseEntity addPet( + @Valid ResponseEntity addPet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) throws Exception; @@ -134,7 +134,7 @@ ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/json", "application/xml" } ) - ResponseEntity> findPetsByStatus( + @Valid ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", deprecated = true, description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) @Deprecated List status ) throws Exception; @@ -172,7 +172,7 @@ ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/json", "application/xml" } ) - ResponseEntity> findPetsByTags( + @Valid ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) List tags ) throws Exception; @@ -209,7 +209,7 @@ ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/json", "application/xml" } ) - ResponseEntity getPetById( + @Valid ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) throws Exception; @@ -252,7 +252,7 @@ ResponseEntity getPetById( produces = { "application/json", "application/xml" }, consumes = "application/json" ) - ResponseEntity updatePet( + @Valid ResponseEntity updatePet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) throws Exception; @@ -321,7 +321,7 @@ ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = "multipart/form-data" ) - ResponseEntity uploadFile( + @Valid ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/StoreApi.java index 901cfd6141dd..7d0d9bb6cf94 100644 --- a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/StoreApi.java @@ -90,7 +90,7 @@ ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - ResponseEntity> getInventory( + @Valid ResponseEntity> getInventory( ) throws Exception; @@ -124,7 +124,7 @@ ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/json", "application/xml" } ) - ResponseEntity getOrderById( + @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId ) throws Exception; @@ -157,7 +157,7 @@ ResponseEntity getOrderById( produces = { "application/json", "application/xml" }, consumes = "application/json" ) - ResponseEntity placeOrder( + @Valid ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) throws Exception; diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/UserApi.java index ee826623ce77..36957258559c 100644 --- a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/api/UserApi.java @@ -186,7 +186,7 @@ ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/json", "application/xml" } ) - ResponseEntity getUserByName( + @Valid ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) throws Exception; @@ -219,7 +219,7 @@ ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/json", "application/xml" } ) - ResponseEntity loginUser( + @Valid ResponseEntity loginUser( @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ) throws Exception; diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java index 98a5de66984e..4bcd35019bd1 100644 --- a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/PetApi.java @@ -75,7 +75,7 @@ default Optional getRequest() { produces = { "application/json", "application/xml" }, consumes = "application/json" ) - default ResponseEntity addPet( + default @Valid ResponseEntity addPet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { getRequest().ifPresent(request -> { @@ -161,7 +161,7 @@ default ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/json", "application/xml" } ) - default ResponseEntity> findPetsByStatus( + default @Valid ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", deprecated = true, description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) @Deprecated List status ) { getRequest().ifPresent(request -> { @@ -216,7 +216,7 @@ default ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/json", "application/xml" } ) - default ResponseEntity> findPetsByTags( + default @Valid ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) List tags ) { getRequest().ifPresent(request -> { @@ -270,7 +270,7 @@ default ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/json", "application/xml" } ) - default ResponseEntity getPetById( + default @Valid ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { getRequest().ifPresent(request -> { @@ -330,7 +330,7 @@ default ResponseEntity getPetById( produces = { "application/json", "application/xml" }, consumes = "application/json" ) - default ResponseEntity updatePet( + default @Valid ResponseEntity updatePet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { getRequest().ifPresent(request -> { @@ -419,7 +419,7 @@ default ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = "multipart/form-data" ) - default ResponseEntity uploadFile( + default @Valid ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java index eadb914c0f8d..fe372bb6a85b 100644 --- a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/StoreApi.java @@ -100,7 +100,7 @@ default ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - default ResponseEntity> getInventory( + default @Valid ResponseEntity> getInventory( ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -137,7 +137,7 @@ default ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/json", "application/xml" } ) - default ResponseEntity getOrderById( + default @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId ) { getRequest().ifPresent(request -> { @@ -187,7 +187,7 @@ default ResponseEntity getOrderById( produces = { "application/json", "application/xml" }, consumes = "application/json" ) - default ResponseEntity placeOrder( + default @Valid ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { getRequest().ifPresent(request -> { diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java index 703cce27fd3d..261380b89d9b 100644 --- a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/api/UserApi.java @@ -205,7 +205,7 @@ default ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/json", "application/xml" } ) - default ResponseEntity getUserByName( + default @Valid ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { getRequest().ifPresent(request -> { @@ -255,7 +255,7 @@ default ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/json", "application/xml" } ) - default ResponseEntity loginUser( + default @Valid ResponseEntity loginUser( @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ) { diff --git a/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/api/BarApi.java b/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/api/BarApi.java index 1e935e455f5e..d36b3d2d0b4b 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/api/BarApi.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/api/BarApi.java @@ -66,7 +66,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity createBar( + default @Valid ResponseEntity createBar( @Parameter(name = "BarCreate", description = "", required = true) @Valid @RequestBody BarCreate barCreate ) { getRequest().ifPresent(request -> { diff --git a/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/api/FooApi.java b/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/api/FooApi.java index 31f338cfcccb..3e7cfa1e48b4 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/api/FooApi.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof-interface/src/main/java/org/openapitools/api/FooApi.java @@ -67,7 +67,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json;charset=utf-8" } ) - default ResponseEntity createFoo( + default @Valid ResponseEntity createFoo( @Parameter(name = "Foo", description = "The Foo to be created") @Valid @RequestBody(required = false) @Nullable Foo foo ) { getRequest().ifPresent(request -> { @@ -105,7 +105,7 @@ default ResponseEntity createFoo( value = FooApi.PATH_GET_ALL_FOOS, produces = { "application/json;charset=utf-8" } ) - default ResponseEntity> getAllFoos( + default @Valid ResponseEntity> getAllFoos( ) { getRequest().ifPresent(request -> { diff --git a/samples/openapi3/server/petstore/spring-boot-oneof-jackson-default-impl/src/main/java/org/openapitools/api/AnimalsApi.java b/samples/openapi3/server/petstore/spring-boot-oneof-jackson-default-impl/src/main/java/org/openapitools/api/AnimalsApi.java index 3e603cb8a6eb..4a6aac86d448 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-jackson-default-impl/src/main/java/org/openapitools/api/AnimalsApi.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof-jackson-default-impl/src/main/java/org/openapitools/api/AnimalsApi.java @@ -64,7 +64,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity createAnimal( + default @Valid ResponseEntity createAnimal( @Parameter(name = "Animal", description = "", required = true) @Valid @RequestBody Animal animal ) { getRequest().ifPresent(request -> { diff --git a/samples/openapi3/server/petstore/spring-boot-oneof-jackson-default-impl/src/main/java/org/openapitools/api/BeveragesApi.java b/samples/openapi3/server/petstore/spring-boot-oneof-jackson-default-impl/src/main/java/org/openapitools/api/BeveragesApi.java index d2d0ac35ba4c..d7adfe89250c 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-jackson-default-impl/src/main/java/org/openapitools/api/BeveragesApi.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof-jackson-default-impl/src/main/java/org/openapitools/api/BeveragesApi.java @@ -64,7 +64,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity createBeverage( + default @Valid ResponseEntity createBeverage( @Parameter(name = "Beverage", description = "", required = true) @Valid @RequestBody Beverage beverage ) { getRequest().ifPresent(request -> { diff --git a/samples/openapi3/server/petstore/spring-boot-oneof-jackson-default-impl/src/main/java/org/openapitools/api/FruitsApi.java b/samples/openapi3/server/petstore/spring-boot-oneof-jackson-default-impl/src/main/java/org/openapitools/api/FruitsApi.java index 36e3f79127fa..23a738b2a75a 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-jackson-default-impl/src/main/java/org/openapitools/api/FruitsApi.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof-jackson-default-impl/src/main/java/org/openapitools/api/FruitsApi.java @@ -64,7 +64,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity createFruit( + default @Valid ResponseEntity createFruit( @Parameter(name = "Fruit", description = "", required = true) @Valid @RequestBody Fruit fruit ) { getRequest().ifPresent(request -> { diff --git a/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/api/BarApi.java b/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/api/BarApi.java index 1e935e455f5e..d36b3d2d0b4b 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/api/BarApi.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/api/BarApi.java @@ -66,7 +66,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity createBar( + default @Valid ResponseEntity createBar( @Parameter(name = "BarCreate", description = "", required = true) @Valid @RequestBody BarCreate barCreate ) { getRequest().ifPresent(request -> { diff --git a/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/api/FooApi.java b/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/api/FooApi.java index 31f338cfcccb..3e7cfa1e48b4 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/api/FooApi.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof-sealed/src/main/java/org/openapitools/api/FooApi.java @@ -67,7 +67,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json;charset=utf-8" } ) - default ResponseEntity createFoo( + default @Valid ResponseEntity createFoo( @Parameter(name = "Foo", description = "The Foo to be created") @Valid @RequestBody(required = false) @Nullable Foo foo ) { getRequest().ifPresent(request -> { @@ -105,7 +105,7 @@ default ResponseEntity createFoo( value = FooApi.PATH_GET_ALL_FOOS, produces = { "application/json;charset=utf-8" } ) - default ResponseEntity> getAllFoos( + default @Valid ResponseEntity> getAllFoos( ) { getRequest().ifPresent(request -> { diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/BarApi.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/BarApi.java index 1e935e455f5e..d36b3d2d0b4b 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/BarApi.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/BarApi.java @@ -66,7 +66,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity createBar( + default @Valid ResponseEntity createBar( @Parameter(name = "BarCreate", description = "", required = true) @Valid @RequestBody BarCreate barCreate ) { getRequest().ifPresent(request -> { diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/FooApi.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/FooApi.java index 31f338cfcccb..3e7cfa1e48b4 100644 --- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/FooApi.java +++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/api/FooApi.java @@ -67,7 +67,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json;charset=utf-8" } ) - default ResponseEntity createFoo( + default @Valid ResponseEntity createFoo( @Parameter(name = "Foo", description = "The Foo to be created") @Valid @RequestBody(required = false) @Nullable Foo foo ) { getRequest().ifPresent(request -> { @@ -105,7 +105,7 @@ default ResponseEntity createFoo( value = FooApi.PATH_GET_ALL_FOOS, produces = { "application/json;charset=utf-8" } ) - default ResponseEntity> getAllFoos( + default @Valid ResponseEntity> getAllFoos( ) { getRequest().ifPresent(request -> { diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApi.java index 4e4d147509ba..e4a5b03ed5a4 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/PetApi.java @@ -75,7 +75,7 @@ default Optional getRequest() { produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) - default ResponseEntity addPet( + default @Valid ResponseEntity addPet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { getRequest().ifPresent(request -> { @@ -161,7 +161,7 @@ default ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus( + default @Valid ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", deprecated = true, description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) @Deprecated List status ) { getRequest().ifPresent(request -> { @@ -216,7 +216,7 @@ default ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags( + default @Valid ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) List tags ) { getRequest().ifPresent(request -> { @@ -270,7 +270,7 @@ default ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById( + default @Valid ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { getRequest().ifPresent(request -> { @@ -330,7 +330,7 @@ default ResponseEntity getPetById( produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) - default ResponseEntity updatePet( + default @Valid ResponseEntity updatePet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { getRequest().ifPresent(request -> { @@ -419,7 +419,7 @@ default ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile( + default @Valid ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApi.java index ed9c67ec1a1f..f09c5f8c1070 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/StoreApi.java @@ -100,7 +100,7 @@ default ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - default ResponseEntity> getInventory( + default @Valid ResponseEntity> getInventory( ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -137,7 +137,7 @@ default ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById( + default @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId ) { getRequest().ifPresent(request -> { @@ -187,7 +187,7 @@ default ResponseEntity getOrderById( produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) - default ResponseEntity placeOrder( + default @Valid ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { getRequest().ifPresent(request -> { diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApi.java index 7085f8406116..3170d7e359ae 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/api/UserApi.java @@ -205,7 +205,7 @@ default ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName( + default @Valid ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { getRequest().ifPresent(request -> { @@ -255,7 +255,7 @@ default ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser( + default @Valid ResponseEntity loginUser( @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ) { diff --git a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/PetApi.java index 55eb8ee6f5e1..3ea3d6f9a7d9 100644 --- a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/PetApi.java @@ -72,7 +72,7 @@ default PetApiDelegate getDelegate() { produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) - default ResponseEntity addPet( + default @Valid ResponseEntity addPet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet, @Parameter(hidden = true) final HttpServletRequest servletRequest ) { @@ -144,7 +144,7 @@ default ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus( + default @Valid ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", deprecated = true, description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) @Deprecated List status, @Parameter(hidden = true) final HttpServletRequest servletRequest ) { @@ -185,7 +185,7 @@ default ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags( + default @Valid ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) List tags, @Parameter(hidden = true) final HttpServletRequest servletRequest ) { @@ -225,7 +225,7 @@ default ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById( + default @Valid ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(hidden = true) final HttpServletRequest servletRequest ) { @@ -271,7 +271,7 @@ default ResponseEntity getPetById( produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) - default ResponseEntity updatePet( + default @Valid ResponseEntity updatePet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet, @Parameter(hidden = true) final HttpServletRequest servletRequest ) { @@ -346,7 +346,7 @@ default ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile( + default @Valid ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file, diff --git a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/PetApiDelegate.java index 5bd338e82a24..5baa4ca153d9 100644 --- a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -37,7 +37,7 @@ default Optional getRequest() { * or Invalid input (status code 405) * @see PetApi#addPet */ - default ResponseEntity addPet(Pet pet, + default @Valid ResponseEntity addPet(Pet pet, HttpServletRequest servletRequest) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -82,7 +82,7 @@ default ResponseEntity deletePet(Long petId, * or Invalid status value (status code 400) * @see PetApi#findPetsByStatus */ - default ResponseEntity> findPetsByStatus(List status, + default @Valid ResponseEntity> findPetsByStatus(List status, HttpServletRequest servletRequest) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -113,7 +113,7 @@ default ResponseEntity> findPetsByStatus(List status, * @see PetApi#findPetsByTags */ @Deprecated - default ResponseEntity> findPetsByTags(List tags, + default @Valid ResponseEntity> findPetsByTags(List tags, HttpServletRequest servletRequest) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -143,7 +143,7 @@ default ResponseEntity> findPetsByTags(List tags, * or Pet not found (status code 404) * @see PetApi#getPetById */ - default ResponseEntity getPetById(Long petId, + default @Valid ResponseEntity getPetById(Long petId, HttpServletRequest servletRequest) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -176,7 +176,7 @@ default ResponseEntity getPetById(Long petId, * @see Update an existing pet Documentation * @see PetApi#updatePet */ - default ResponseEntity updatePet(Pet pet, + default @Valid ResponseEntity updatePet(Pet pet, HttpServletRequest servletRequest) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -224,7 +224,7 @@ default ResponseEntity updatePetWithForm(Long petId, * @return successful operation (status code 200) * @see PetApi#uploadFile */ - default ResponseEntity uploadFile(Long petId, + default @Valid ResponseEntity uploadFile(Long petId, String additionalMetadata, MultipartFile file, HttpServletRequest servletRequest) { diff --git a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/StoreApi.java index 681bf06a8577..2eabde242ce6 100644 --- a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/StoreApi.java @@ -97,7 +97,7 @@ default ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - default ResponseEntity> getInventory( + default @Valid ResponseEntity> getInventory( @Parameter(hidden = true) final HttpServletRequest servletRequest ) { return getDelegate().getInventory(servletRequest); @@ -133,7 +133,7 @@ default ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById( + default @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId, @Parameter(hidden = true) final HttpServletRequest servletRequest ) { @@ -169,7 +169,7 @@ default ResponseEntity getOrderById( produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) - default ResponseEntity placeOrder( + default @Valid ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order, @Parameter(hidden = true) final HttpServletRequest servletRequest ) { diff --git a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/StoreApiDelegate.java b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/StoreApiDelegate.java index c33c2f0f3092..c564054b854e 100644 --- a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/StoreApiDelegate.java +++ b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/StoreApiDelegate.java @@ -49,7 +49,7 @@ default ResponseEntity deleteOrder(String orderId, * @return successful operation (status code 200) * @see StoreApi#getInventory */ - default ResponseEntity> getInventory(HttpServletRequest servletRequest) { + default @Valid ResponseEntity> getInventory(HttpServletRequest servletRequest) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -64,7 +64,7 @@ default ResponseEntity> getInventory(HttpServletRequest ser * or Order not found (status code 404) * @see StoreApi#getOrderById */ - default ResponseEntity getOrderById(Long orderId, + default @Valid ResponseEntity getOrderById(Long orderId, HttpServletRequest servletRequest) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -93,7 +93,7 @@ default ResponseEntity getOrderById(Long orderId, * or Invalid Order (status code 400) * @see StoreApi#placeOrder */ - default ResponseEntity placeOrder(Order order, + default @Valid ResponseEntity placeOrder(Order order, HttpServletRequest servletRequest) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/UserApi.java index 23ab58eb70d6..29e087e26d10 100644 --- a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/UserApi.java @@ -202,7 +202,7 @@ default ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName( + default @Valid ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, @Parameter(hidden = true) final HttpServletRequest servletRequest ) { @@ -238,7 +238,7 @@ default ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser( + default @Valid ResponseEntity loginUser( @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password, @Parameter(hidden = true) final HttpServletRequest servletRequest diff --git a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/UserApiDelegate.java index d48726f7340d..e56220d28f8b 100644 --- a/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/openapi3/server/petstore/springboot-3-include-http-request-context/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -94,7 +94,7 @@ default ResponseEntity deleteUser(String username, * or User not found (status code 404) * @see UserApi#getUserByName */ - default ResponseEntity getUserByName(String username, + default @Valid ResponseEntity getUserByName(String username, HttpServletRequest servletRequest) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -124,7 +124,7 @@ default ResponseEntity getUserByName(String username, * or Invalid username/password supplied (status code 400) * @see UserApi#loginUser */ - default ResponseEntity loginUser(String username, + default @Valid ResponseEntity loginUser(String username, String password, HttpServletRequest servletRequest) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/PetApi.java index 4e4d147509ba..e4a5b03ed5a4 100644 --- a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/PetApi.java @@ -75,7 +75,7 @@ default Optional getRequest() { produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) - default ResponseEntity addPet( + default @Valid ResponseEntity addPet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { getRequest().ifPresent(request -> { @@ -161,7 +161,7 @@ default ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus( + default @Valid ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", deprecated = true, description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) @Deprecated List status ) { getRequest().ifPresent(request -> { @@ -216,7 +216,7 @@ default ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags( + default @Valid ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) List tags ) { getRequest().ifPresent(request -> { @@ -270,7 +270,7 @@ default ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById( + default @Valid ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { getRequest().ifPresent(request -> { @@ -330,7 +330,7 @@ default ResponseEntity getPetById( produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) - default ResponseEntity updatePet( + default @Valid ResponseEntity updatePet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { getRequest().ifPresent(request -> { @@ -419,7 +419,7 @@ default ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile( + default @Valid ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/StoreApi.java index ed9c67ec1a1f..f09c5f8c1070 100644 --- a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/StoreApi.java @@ -100,7 +100,7 @@ default ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - default ResponseEntity> getInventory( + default @Valid ResponseEntity> getInventory( ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -137,7 +137,7 @@ default ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById( + default @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId ) { getRequest().ifPresent(request -> { @@ -187,7 +187,7 @@ default ResponseEntity getOrderById( produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) - default ResponseEntity placeOrder( + default @Valid ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { getRequest().ifPresent(request -> { diff --git a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/UserApi.java index 7085f8406116..3170d7e359ae 100644 --- a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/api/UserApi.java @@ -205,7 +205,7 @@ default ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName( + default @Valid ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { getRequest().ifPresent(request -> { @@ -255,7 +255,7 @@ default ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser( + default @Valid ResponseEntity loginUser( @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ) { diff --git a/samples/openapi3/server/petstore/springboot-4-jspecify-openapiNullable/src/main/java/org/openapitools/api/FileApi.java b/samples/openapi3/server/petstore/springboot-4-jspecify-openapiNullable/src/main/java/org/openapitools/api/FileApi.java index 00fdfe844cc5..1cc8d6c45266 100644 --- a/samples/openapi3/server/petstore/springboot-4-jspecify-openapiNullable/src/main/java/org/openapitools/api/FileApi.java +++ b/samples/openapi3/server/petstore/springboot-4-jspecify-openapiNullable/src/main/java/org/openapitools/api/FileApi.java @@ -63,7 +63,7 @@ default Optional getRequest() { value = FileApi.PATH_FILE_ID_GET, produces = { "application/json" } ) - default ResponseEntity fileIdGet( + default @Valid ResponseEntity fileIdGet( @Parameter(name = "id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("id") String id ) { getRequest().ifPresent(request -> { diff --git a/samples/openapi3/server/petstore/springboot-4-jspecify-openapiNullable/src/main/java/org/openapitools/api/FooApi.java b/samples/openapi3/server/petstore/springboot-4-jspecify-openapiNullable/src/main/java/org/openapitools/api/FooApi.java index 9ed99e69a163..a3bfe83f187f 100644 --- a/samples/openapi3/server/petstore/springboot-4-jspecify-openapiNullable/src/main/java/org/openapitools/api/FooApi.java +++ b/samples/openapi3/server/petstore/springboot-4-jspecify-openapiNullable/src/main/java/org/openapitools/api/FooApi.java @@ -69,7 +69,7 @@ default Optional getRequest() { value = FooApi.PATH_FOO_DT_PARAM_GET, produces = { "application/json" } ) - default ResponseEntity fooDtParamGet( + default @Valid ResponseEntity fooDtParamGet( @Parameter(name = "dtParam", description = "", in = ParameterIn.PATH) @PathVariable("dtParam") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) java.time.@Nullable Instant dtParam, @Parameter(name = "dtQuery", description = "", in = ParameterIn.QUERY) @Valid @RequestParam(value = "dtQuery", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) java.time.@Nullable Instant dtQuery, @Parameter(name = "dtCookie", description = "", in = ParameterIn.COOKIE) @CookieValue(name = "dtCookie", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) java.time.@Nullable Instant dtCookie, diff --git a/samples/openapi3/server/petstore/springboot-4-jspecify-openapiNullable/src/main/java/org/openapitools/api/RequiredAndNullableApi.java b/samples/openapi3/server/petstore/springboot-4-jspecify-openapiNullable/src/main/java/org/openapitools/api/RequiredAndNullableApi.java index 46c024c844d5..5fe22a93fda8 100644 --- a/samples/openapi3/server/petstore/springboot-4-jspecify-openapiNullable/src/main/java/org/openapitools/api/RequiredAndNullableApi.java +++ b/samples/openapi3/server/petstore/springboot-4-jspecify-openapiNullable/src/main/java/org/openapitools/api/RequiredAndNullableApi.java @@ -64,7 +64,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity requiredAndNullablePost( + default @Valid ResponseEntity requiredAndNullablePost( @Parameter(name = "RequiredAndNullable", description = "bodyWithRequiredAndNullableAttributes", required = true) @Valid @RequestBody RequiredAndNullable requiredAndNullable ) { getRequest().ifPresent(request -> { diff --git a/samples/openapi3/server/petstore/springboot-4-jspecify-useOptional/src/main/java/org/openapitools/api/FileApi.java b/samples/openapi3/server/petstore/springboot-4-jspecify-useOptional/src/main/java/org/openapitools/api/FileApi.java index 00fdfe844cc5..1cc8d6c45266 100644 --- a/samples/openapi3/server/petstore/springboot-4-jspecify-useOptional/src/main/java/org/openapitools/api/FileApi.java +++ b/samples/openapi3/server/petstore/springboot-4-jspecify-useOptional/src/main/java/org/openapitools/api/FileApi.java @@ -63,7 +63,7 @@ default Optional getRequest() { value = FileApi.PATH_FILE_ID_GET, produces = { "application/json" } ) - default ResponseEntity fileIdGet( + default @Valid ResponseEntity fileIdGet( @Parameter(name = "id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("id") String id ) { getRequest().ifPresent(request -> { diff --git a/samples/openapi3/server/petstore/springboot-4-jspecify-useOptional/src/main/java/org/openapitools/api/FooApi.java b/samples/openapi3/server/petstore/springboot-4-jspecify-useOptional/src/main/java/org/openapitools/api/FooApi.java index 53e64cce217e..97103ac90471 100644 --- a/samples/openapi3/server/petstore/springboot-4-jspecify-useOptional/src/main/java/org/openapitools/api/FooApi.java +++ b/samples/openapi3/server/petstore/springboot-4-jspecify-useOptional/src/main/java/org/openapitools/api/FooApi.java @@ -69,7 +69,7 @@ default Optional getRequest() { value = FooApi.PATH_FOO_DT_PARAM_GET, produces = { "application/json" } ) - default ResponseEntity fooDtParamGet( + default @Valid ResponseEntity fooDtParamGet( @Parameter(name = "dtParam", description = "", in = ParameterIn.PATH) @PathVariable("dtParam") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) Optional dtParam, @Parameter(name = "dtQuery", description = "", in = ParameterIn.QUERY) @RequestParam(value = "dtQuery", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) Optional dtQuery, @Parameter(name = "dtCookie", description = "", in = ParameterIn.COOKIE) @CookieValue(name = "dtCookie", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) Optional dtCookie, diff --git a/samples/openapi3/server/petstore/springboot-4-jspecify-useOptional/src/main/java/org/openapitools/api/RequiredAndNullableApi.java b/samples/openapi3/server/petstore/springboot-4-jspecify-useOptional/src/main/java/org/openapitools/api/RequiredAndNullableApi.java index 46c024c844d5..5fe22a93fda8 100644 --- a/samples/openapi3/server/petstore/springboot-4-jspecify-useOptional/src/main/java/org/openapitools/api/RequiredAndNullableApi.java +++ b/samples/openapi3/server/petstore/springboot-4-jspecify-useOptional/src/main/java/org/openapitools/api/RequiredAndNullableApi.java @@ -64,7 +64,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity requiredAndNullablePost( + default @Valid ResponseEntity requiredAndNullablePost( @Parameter(name = "RequiredAndNullable", description = "bodyWithRequiredAndNullableAttributes", required = true) @Valid @RequestBody RequiredAndNullable requiredAndNullable ) { getRequest().ifPresent(request -> { diff --git a/samples/openapi3/server/petstore/springboot-4-jspecify/src/main/java/org/openapitools/api/FileApi.java b/samples/openapi3/server/petstore/springboot-4-jspecify/src/main/java/org/openapitools/api/FileApi.java index 00fdfe844cc5..1cc8d6c45266 100644 --- a/samples/openapi3/server/petstore/springboot-4-jspecify/src/main/java/org/openapitools/api/FileApi.java +++ b/samples/openapi3/server/petstore/springboot-4-jspecify/src/main/java/org/openapitools/api/FileApi.java @@ -63,7 +63,7 @@ default Optional getRequest() { value = FileApi.PATH_FILE_ID_GET, produces = { "application/json" } ) - default ResponseEntity fileIdGet( + default @Valid ResponseEntity fileIdGet( @Parameter(name = "id", description = "", required = true, in = ParameterIn.PATH) @PathVariable("id") String id ) { getRequest().ifPresent(request -> { diff --git a/samples/openapi3/server/petstore/springboot-4-jspecify/src/main/java/org/openapitools/api/FooApi.java b/samples/openapi3/server/petstore/springboot-4-jspecify/src/main/java/org/openapitools/api/FooApi.java index 9ed99e69a163..a3bfe83f187f 100644 --- a/samples/openapi3/server/petstore/springboot-4-jspecify/src/main/java/org/openapitools/api/FooApi.java +++ b/samples/openapi3/server/petstore/springboot-4-jspecify/src/main/java/org/openapitools/api/FooApi.java @@ -69,7 +69,7 @@ default Optional getRequest() { value = FooApi.PATH_FOO_DT_PARAM_GET, produces = { "application/json" } ) - default ResponseEntity fooDtParamGet( + default @Valid ResponseEntity fooDtParamGet( @Parameter(name = "dtParam", description = "", in = ParameterIn.PATH) @PathVariable("dtParam") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) java.time.@Nullable Instant dtParam, @Parameter(name = "dtQuery", description = "", in = ParameterIn.QUERY) @Valid @RequestParam(value = "dtQuery", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) java.time.@Nullable Instant dtQuery, @Parameter(name = "dtCookie", description = "", in = ParameterIn.COOKIE) @CookieValue(name = "dtCookie", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) java.time.@Nullable Instant dtCookie, diff --git a/samples/openapi3/server/petstore/springboot-4-jspecify/src/main/java/org/openapitools/api/RequiredAndNullableApi.java b/samples/openapi3/server/petstore/springboot-4-jspecify/src/main/java/org/openapitools/api/RequiredAndNullableApi.java index 46c024c844d5..5fe22a93fda8 100644 --- a/samples/openapi3/server/petstore/springboot-4-jspecify/src/main/java/org/openapitools/api/RequiredAndNullableApi.java +++ b/samples/openapi3/server/petstore/springboot-4-jspecify/src/main/java/org/openapitools/api/RequiredAndNullableApi.java @@ -64,7 +64,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity requiredAndNullablePost( + default @Valid ResponseEntity requiredAndNullablePost( @Parameter(name = "RequiredAndNullable", description = "bodyWithRequiredAndNullableAttributes", required = true) @Valid @RequestBody RequiredAndNullable requiredAndNullable ) { getRequest().ifPresent(request -> { diff --git a/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/api/PetApi.java index 4e4d147509ba..e4a5b03ed5a4 100644 --- a/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/api/PetApi.java @@ -75,7 +75,7 @@ default Optional getRequest() { produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) - default ResponseEntity addPet( + default @Valid ResponseEntity addPet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { getRequest().ifPresent(request -> { @@ -161,7 +161,7 @@ default ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus( + default @Valid ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", deprecated = true, description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) @Deprecated List status ) { getRequest().ifPresent(request -> { @@ -216,7 +216,7 @@ default ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags( + default @Valid ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) List tags ) { getRequest().ifPresent(request -> { @@ -270,7 +270,7 @@ default ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById( + default @Valid ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { getRequest().ifPresent(request -> { @@ -330,7 +330,7 @@ default ResponseEntity getPetById( produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) - default ResponseEntity updatePet( + default @Valid ResponseEntity updatePet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { getRequest().ifPresent(request -> { @@ -419,7 +419,7 @@ default ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile( + default @Valid ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/api/StoreApi.java index ed9c67ec1a1f..f09c5f8c1070 100644 --- a/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/api/StoreApi.java @@ -100,7 +100,7 @@ default ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - default ResponseEntity> getInventory( + default @Valid ResponseEntity> getInventory( ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -137,7 +137,7 @@ default ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById( + default @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId ) { getRequest().ifPresent(request -> { @@ -187,7 +187,7 @@ default ResponseEntity getOrderById( produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) - default ResponseEntity placeOrder( + default @Valid ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { getRequest().ifPresent(request -> { diff --git a/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/api/UserApi.java index 7085f8406116..3170d7e359ae 100644 --- a/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot-4/src/main/java/org/openapitools/api/UserApi.java @@ -205,7 +205,7 @@ default ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName( + default @Valid ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { getRequest().ifPresent(request -> { @@ -255,7 +255,7 @@ default ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser( + default @Valid ResponseEntity loginUser( @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ) { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java index 9b57d7a450b0..936821c06a41 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -63,7 +63,7 @@ default AnotherFakeApiDelegate getDelegate() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity call123testSpecialTags( + default @Valid ResponseEntity call123testSpecialTags( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { return getDelegate().call123testSpecialTags(client); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java index 14f4311445e8..53c305fa243d 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java @@ -33,7 +33,7 @@ default Optional getRequest() { * @return successful operation (status code 200) * @see AnotherFakeApi#call123testSpecialTags */ - default ResponseEntity call123testSpecialTags(Client client) { + default @Valid ResponseEntity call123testSpecialTags(Client client) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java index ac38d236b8c5..3de79e5df18c 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java @@ -104,7 +104,7 @@ default ResponseEntity createXmlItem( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterBooleanSerialize( + default @Valid ResponseEntity fakeOuterBooleanSerialize( @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) @Nullable Boolean body ) { return getDelegate().fakeOuterBooleanSerialize(body); @@ -135,7 +135,7 @@ default ResponseEntity fakeOuterBooleanSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterCompositeSerialize( + default @Valid ResponseEntity fakeOuterCompositeSerialize( @Parameter(name = "OuterComposite", description = "Input composite as post body") @Valid @RequestBody(required = false) @Nullable OuterComposite outerComposite ) { return getDelegate().fakeOuterCompositeSerialize(outerComposite); @@ -166,7 +166,7 @@ default ResponseEntity fakeOuterCompositeSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterNumberSerialize( + default @Valid ResponseEntity fakeOuterNumberSerialize( @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) @Nullable BigDecimal body ) { return getDelegate().fakeOuterNumberSerialize(body); @@ -197,7 +197,7 @@ default ResponseEntity fakeOuterNumberSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterStringSerialize( + default @Valid ResponseEntity fakeOuterStringSerialize( @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) @Nullable String body ) { return getDelegate().fakeOuterStringSerialize(body); @@ -225,7 +225,7 @@ default ResponseEntity fakeOuterStringSerialize( value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) - default ResponseEntity responseObjectDifferentNames( + default @Valid ResponseEntity responseObjectDifferentNames( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { return getDelegate().responseObjectDifferentNames(petId); @@ -313,7 +313,7 @@ default ResponseEntity testBodyWithQueryParams( produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClientModel( + default @Valid ResponseEntity testClientModel( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { return getDelegate().testClientModel(client); @@ -607,7 +607,7 @@ default ResponseEntity testQueryParameterCollectionFormat( value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) - default ResponseEntity testWithResultExample( + default @Valid ResponseEntity testWithResultExample( ) { return getDelegate().testWithResultExample(); @@ -644,7 +644,7 @@ default ResponseEntity testWithResultExample( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFileWithRequiredFile( + default @Valid ResponseEntity uploadFileWithRequiredFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java index e1e5fd5a8305..77253fbbe4a5 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -59,7 +59,7 @@ default ResponseEntity createXmlItem(XmlItem xmlItem) { * @return Output boolean (status code 200) * @see FakeApi#fakeOuterBooleanSerialize */ - default ResponseEntity fakeOuterBooleanSerialize(Boolean body) { + default @Valid ResponseEntity fakeOuterBooleanSerialize(Boolean body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -72,7 +72,7 @@ default ResponseEntity fakeOuterBooleanSerialize(Boolean body) { * @return Output composite (status code 200) * @see FakeApi#fakeOuterCompositeSerialize */ - default ResponseEntity fakeOuterCompositeSerialize(OuterComposite outerComposite) { + default @Valid ResponseEntity fakeOuterCompositeSerialize(OuterComposite outerComposite) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { @@ -94,7 +94,7 @@ default ResponseEntity fakeOuterCompositeSerialize(OuterComposit * @return Output number (status code 200) * @see FakeApi#fakeOuterNumberSerialize */ - default ResponseEntity fakeOuterNumberSerialize(BigDecimal body) { + default @Valid ResponseEntity fakeOuterNumberSerialize(BigDecimal body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -107,7 +107,7 @@ default ResponseEntity fakeOuterNumberSerialize(BigDecimal body) { * @return Output string (status code 200) * @see FakeApi#fakeOuterStringSerialize */ - default ResponseEntity fakeOuterStringSerialize(String body) { + default @Valid ResponseEntity fakeOuterStringSerialize(String body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -119,7 +119,7 @@ default ResponseEntity fakeOuterStringSerialize(String body) { * @return successful operation (status code 200) * @see FakeApi#responseObjectDifferentNames */ - default ResponseEntity responseObjectDifferentNames(Long petId) { + default @Valid ResponseEntity responseObjectDifferentNames(Long petId) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -168,7 +168,7 @@ default ResponseEntity testBodyWithQueryParams(String query, * @return successful operation (status code 200) * @see FakeApi#testClientModel */ - default ResponseEntity testClientModel(Client client) { + default @Valid ResponseEntity testClientModel(Client client) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -340,7 +340,7 @@ default ResponseEntity testQueryParameterCollectionFormat(List pip * @return Success (status code 200) * @see FakeApi#testWithResultExample */ - default ResponseEntity testWithResultExample() { + default @Valid ResponseEntity testWithResultExample() { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -364,7 +364,7 @@ default ResponseEntity testWithResultExample() { * @return successful operation (status code 200) * @see FakeApi#uploadFileWithRequiredFile */ - default ResponseEntity uploadFileWithRequiredFile(Long petId, + default @Valid ResponseEntity uploadFileWithRequiredFile(Long petId, MultipartFile requiredFile, String additionalMetadata) { getRequest().ifPresent(request -> { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 1af7a821e465..0aed831719f9 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -66,7 +66,7 @@ default FakeClassnameTestApiDelegate getDelegate() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClassname( + default @Valid ResponseEntity testClassname( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { return getDelegate().testClassname(client); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java index 376433f1fd53..af53d7a0ec50 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java @@ -33,7 +33,7 @@ default Optional getRequest() { * @return successful operation (status code 200) * @see FakeClassnameTestApi#testClassname */ - default ResponseEntity testClassname(Client client) { + default @Valid ResponseEntity testClassname(Client client) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java index dd52990f5897..ff38f5fcc6da 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java @@ -140,7 +140,7 @@ default ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus( + default @Valid ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) List status ) { return getDelegate().findPetsByStatus(status); @@ -180,7 +180,7 @@ default ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags( + default @Valid ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) Set tags ) { return getDelegate().findPetsByTags(tags); @@ -219,7 +219,7 @@ default ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById( + default @Valid ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { return getDelegate().getPetById(petId); @@ -330,7 +330,7 @@ default ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile( + default @Valid ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java index 085a27846c24..f79325e13113 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -67,7 +67,7 @@ default ResponseEntity deletePet(Long petId, * or Invalid status value (status code 400) * @see PetApi#findPetsByStatus */ - default ResponseEntity> findPetsByStatus(List status) { + default @Valid ResponseEntity> findPetsByStatus(List status) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -97,7 +97,7 @@ default ResponseEntity> findPetsByStatus(List status) { * @see PetApi#findPetsByTags */ @Deprecated - default ResponseEntity> findPetsByTags(Set tags) { + default @Valid ResponseEntity> findPetsByTags(Set tags) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -126,7 +126,7 @@ default ResponseEntity> findPetsByTags(Set tags) { * or Pet not found (status code 404) * @see PetApi#getPetById */ - default ResponseEntity getPetById(Long petId) { + default @Valid ResponseEntity getPetById(Long petId) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -188,7 +188,7 @@ default ResponseEntity updatePetWithForm(Long petId, * @return successful operation (status code 200) * @see PetApi#uploadFile */ - default ResponseEntity uploadFile(Long petId, + default @Valid ResponseEntity uploadFile(Long petId, String additionalMetadata, MultipartFile file) { getRequest().ifPresent(request -> { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java index b87690ad9bdd..0cb4a880d9dd 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java @@ -95,7 +95,7 @@ default ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - default ResponseEntity> getInventory( + default @Valid ResponseEntity> getInventory( ) { return getDelegate().getInventory(); @@ -131,7 +131,7 @@ default ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById( + default @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("order_id") Long orderId ) { return getDelegate().getOrderById(orderId); @@ -166,7 +166,7 @@ default ResponseEntity getOrderById( produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) - default ResponseEntity placeOrder( + default @Valid ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { return getDelegate().placeOrder(order); diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiDelegate.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiDelegate.java index 0beabb5b845c..79d1a9a9c26e 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiDelegate.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiDelegate.java @@ -47,7 +47,7 @@ default ResponseEntity deleteOrder(String orderId) { * @return successful operation (status code 200) * @see StoreApi#getInventory */ - default ResponseEntity> getInventory() { + default @Valid ResponseEntity> getInventory() { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -62,7 +62,7 @@ default ResponseEntity> getInventory() { * or Order not found (status code 404) * @see StoreApi#getOrderById */ - default ResponseEntity getOrderById(Long orderId) { + default @Valid ResponseEntity getOrderById(Long orderId) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -90,7 +90,7 @@ default ResponseEntity getOrderById(Long orderId) { * or Invalid Order (status code 400) * @see StoreApi#placeOrder */ - default ResponseEntity placeOrder(Order order) { + default @Valid ResponseEntity placeOrder(Order order) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java index 6ec40fa05eb5..9f5257331595 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java @@ -185,7 +185,7 @@ default ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName( + default @Valid ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { return getDelegate().getUserByName(username); @@ -220,7 +220,7 @@ default ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser( + default @Valid ResponseEntity loginUser( @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ) { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java index e9c84c0901f2..71a53fc34ef9 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -89,7 +89,7 @@ default ResponseEntity deleteUser(String username) { * or User not found (status code 404) * @see UserApi#getUserByName */ - default ResponseEntity getUserByName(String username) { + default @Valid ResponseEntity getUserByName(String username) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -118,7 +118,7 @@ default ResponseEntity getUserByName(String username) { * or Invalid username/password supplied (status code 400) * @see UserApi#loginUser */ - default ResponseEntity loginUser(String username, + default @Valid ResponseEntity loginUser(String username, String password) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java index c7d3b596ff27..359d1cb80252 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -67,7 +67,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity call123testSpecialTags( + default @Valid ResponseEntity call123testSpecialTags( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java index cc008b21ad1a..2948548115da 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java @@ -109,7 +109,7 @@ default ResponseEntity createXmlItem( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterBooleanSerialize( + default @Valid ResponseEntity fakeOuterBooleanSerialize( @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) @Nullable Boolean body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -141,7 +141,7 @@ default ResponseEntity fakeOuterBooleanSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterCompositeSerialize( + default @Valid ResponseEntity fakeOuterCompositeSerialize( @Parameter(name = "OuterComposite", description = "Input composite as post body") @Valid @RequestBody(required = false) @Nullable OuterComposite outerComposite ) { getRequest().ifPresent(request -> { @@ -182,7 +182,7 @@ default ResponseEntity fakeOuterCompositeSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterNumberSerialize( + default @Valid ResponseEntity fakeOuterNumberSerialize( @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) @Nullable BigDecimal body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -214,7 +214,7 @@ default ResponseEntity fakeOuterNumberSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterStringSerialize( + default @Valid ResponseEntity fakeOuterStringSerialize( @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) @Nullable String body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -243,7 +243,7 @@ default ResponseEntity fakeOuterStringSerialize( value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) - default ResponseEntity responseObjectDifferentNames( + default @Valid ResponseEntity responseObjectDifferentNames( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { getRequest().ifPresent(request -> { @@ -343,7 +343,7 @@ default ResponseEntity testBodyWithQueryParams( produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClientModel( + default @Valid ResponseEntity testClientModel( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { @@ -654,7 +654,7 @@ default ResponseEntity testQueryParameterCollectionFormat( value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) - default ResponseEntity testWithResultExample( + default @Valid ResponseEntity testWithResultExample( ) { getRequest().ifPresent(request -> { @@ -701,7 +701,7 @@ default ResponseEntity testWithResultExample( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFileWithRequiredFile( + default @Valid ResponseEntity uploadFileWithRequiredFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index d276d199d029..41b703bf6839 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -70,7 +70,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClassname( + default @Valid ResponseEntity testClassname( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java index aff493a38133..cb44c5872ee7 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java @@ -147,7 +147,7 @@ default ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus( + default @Valid ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) List status ) { getRequest().ifPresent(request -> { @@ -202,7 +202,7 @@ default ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags( + default @Valid ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) Set tags ) { getRequest().ifPresent(request -> { @@ -256,7 +256,7 @@ default ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById( + default @Valid ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { getRequest().ifPresent(request -> { @@ -384,7 +384,7 @@ default ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile( + default @Valid ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java index bb9732678b51..9ce26f80b655 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java @@ -100,7 +100,7 @@ default ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - default ResponseEntity> getInventory( + default @Valid ResponseEntity> getInventory( ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -137,7 +137,7 @@ default ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById( + default @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("order_id") Long orderId ) { getRequest().ifPresent(request -> { @@ -187,7 +187,7 @@ default ResponseEntity getOrderById( produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) - default ResponseEntity placeOrder( + default @Valid ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { getRequest().ifPresent(request -> { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java index bf58d111c614..a848e02a8cf1 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java @@ -193,7 +193,7 @@ default ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName( + default @Valid ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { getRequest().ifPresent(request -> { @@ -243,7 +243,7 @@ default ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser( + default @Valid ResponseEntity loginUser( @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ) { diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApi.java index 30f0f783286b..e4cd93505902 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/PetApi.java @@ -46,7 +46,7 @@ default Optional getRequest() { produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) - default ResponseEntity addPet( + default @Valid ResponseEntity addPet( @Valid @RequestBody Pet pet ) { getRequest().ifPresent(request -> { @@ -104,7 +104,7 @@ default ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus( + default @Valid ResponseEntity> findPetsByStatus( @NotNull @RequestParam(value = "status", required = true) @Deprecated List status ) { getRequest().ifPresent(request -> { @@ -142,7 +142,7 @@ default ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags( + default @Valid ResponseEntity> findPetsByTags( @NotNull @RequestParam(value = "tags", required = true) List tags ) { getRequest().ifPresent(request -> { @@ -179,7 +179,7 @@ default ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById( + default @Valid ResponseEntity getPetById( @PathVariable("petId") Long petId ) { getRequest().ifPresent(request -> { @@ -220,7 +220,7 @@ default ResponseEntity getPetById( produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) - default ResponseEntity updatePet( + default @Valid ResponseEntity updatePet( @Valid @RequestBody Pet pet ) { getRequest().ifPresent(request -> { @@ -283,7 +283,7 @@ default ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile( + default @Valid ResponseEntity uploadFile( @PathVariable("petId") Long petId, @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApi.java index 92d321ed5a41..1f7a484fb770 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/StoreApi.java @@ -63,7 +63,7 @@ default ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - default ResponseEntity> getInventory( + default @Valid ResponseEntity> getInventory( ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -86,7 +86,7 @@ default ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById( + default @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @PathVariable("orderId") Long orderId ) { getRequest().ifPresent(request -> { @@ -123,7 +123,7 @@ default ResponseEntity getOrderById( produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) - default ResponseEntity placeOrder( + default @Valid ResponseEntity placeOrder( @Valid @RequestBody Order order ) { getRequest().ifPresent(request -> { diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApi.java index e10b1fed9118..82f04206acda 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/api/UserApi.java @@ -129,7 +129,7 @@ default ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName( + default @Valid ResponseEntity getUserByName( @PathVariable("username") String username ) { getRequest().ifPresent(request -> { @@ -166,7 +166,7 @@ default ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser( + default @Valid ResponseEntity loginUser( @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Valid @RequestParam(value = "password", required = true) String password ) { diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java index e62882c0a666..0aee76a37307 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java @@ -76,7 +76,7 @@ default Optional getRequest() { produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) - default ResponseEntity addPet( + default @Valid ResponseEntity addPet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { getRequest().ifPresent(request -> { @@ -162,7 +162,7 @@ default ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus( + default @Valid ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", deprecated = true, description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) @Deprecated List status ) { getRequest().ifPresent(request -> { @@ -217,7 +217,7 @@ default ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags( + default @Valid ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) List tags ) { getRequest().ifPresent(request -> { @@ -271,7 +271,7 @@ default ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById( + default @Valid ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { getRequest().ifPresent(request -> { @@ -331,7 +331,7 @@ default ResponseEntity getPetById( produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) - default ResponseEntity updatePet( + default @Valid ResponseEntity updatePet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { getRequest().ifPresent(request -> { @@ -420,7 +420,7 @@ default ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile( + default @Valid ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java index f9aab98ff0b0..eb3db16069eb 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java @@ -101,7 +101,7 @@ default ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - default ResponseEntity> getInventory( + default @Valid ResponseEntity> getInventory( ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -138,7 +138,7 @@ default ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById( + default @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId ) { getRequest().ifPresent(request -> { @@ -188,7 +188,7 @@ default ResponseEntity getOrderById( produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) - default ResponseEntity placeOrder( + default @Valid ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { getRequest().ifPresent(request -> { diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java index e598750151ee..536aae4699a8 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java @@ -206,7 +206,7 @@ default ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName( + default @Valid ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { getRequest().ifPresent(request -> { @@ -256,7 +256,7 @@ default ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser( + default @Valid ResponseEntity loginUser( @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ) { diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/api/AnotherFakeApi.java index 970753904001..7f45ab6f5513 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -60,7 +60,7 @@ public interface AnotherFakeApi { produces = { "application/json" }, consumes = { "application/json" } ) - ResponseEntity call123testSpecialTags( + @Valid ResponseEntity call123testSpecialTags( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) throws Exception; diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/api/FakeApi.java index c8b4b9132694..f1b0370e19ae 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/api/FakeApi.java @@ -99,7 +99,7 @@ ResponseEntity createXmlItem( produces = { "*/*" }, consumes = { "application/json" } ) - ResponseEntity fakeOuterBooleanSerialize( + @Valid ResponseEntity fakeOuterBooleanSerialize( @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) @Nullable Boolean body ) throws Exception; @@ -128,7 +128,7 @@ ResponseEntity fakeOuterBooleanSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - ResponseEntity fakeOuterCompositeSerialize( + @Valid ResponseEntity fakeOuterCompositeSerialize( @Parameter(name = "OuterComposite", description = "Input composite as post body") @Valid @RequestBody(required = false) @Nullable OuterComposite outerComposite ) throws Exception; @@ -157,7 +157,7 @@ ResponseEntity fakeOuterCompositeSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - ResponseEntity fakeOuterNumberSerialize( + @Valid ResponseEntity fakeOuterNumberSerialize( @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) @Nullable BigDecimal body ) throws Exception; @@ -186,7 +186,7 @@ ResponseEntity fakeOuterNumberSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - ResponseEntity fakeOuterStringSerialize( + @Valid ResponseEntity fakeOuterStringSerialize( @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) @Nullable String body ) throws Exception; @@ -212,7 +212,7 @@ ResponseEntity fakeOuterStringSerialize( value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) - ResponseEntity responseObjectDifferentNames( + @Valid ResponseEntity responseObjectDifferentNames( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) throws Exception; @@ -294,7 +294,7 @@ ResponseEntity testBodyWithQueryParams( produces = { "application/json" }, consumes = { "application/json" } ) - ResponseEntity testClientModel( + @Valid ResponseEntity testClientModel( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) throws Exception; @@ -572,7 +572,7 @@ ResponseEntity testQueryParameterCollectionFormat( value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) - ResponseEntity testWithResultExample( + @Valid ResponseEntity testWithResultExample( ) throws Exception; @@ -607,7 +607,7 @@ ResponseEntity testWithResultExample( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - ResponseEntity uploadFileWithRequiredFile( + @Valid ResponseEntity uploadFileWithRequiredFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 0b80dc030662..caebb7de0fb2 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -63,7 +63,7 @@ public interface FakeClassnameTestApi { produces = { "application/json" }, consumes = { "application/json" } ) - ResponseEntity testClassname( + @Valid ResponseEntity testClassname( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) throws Exception; diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/api/PetApi.java index 17a7a45ee3fb..de96ce6425f7 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/api/PetApi.java @@ -133,7 +133,7 @@ ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) - ResponseEntity> findPetsByStatus( + @Valid ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) List status ) throws Exception; @@ -171,7 +171,7 @@ ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) - ResponseEntity> findPetsByTags( + @Valid ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) Set tags ) throws Exception; @@ -208,7 +208,7 @@ ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) - ResponseEntity getPetById( + @Valid ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) throws Exception; @@ -313,7 +313,7 @@ ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - ResponseEntity uploadFile( + @Valid ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/api/StoreApi.java index 25dfe110686c..75717c1c0a71 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/api/StoreApi.java @@ -90,7 +90,7 @@ ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - ResponseEntity> getInventory( + @Valid ResponseEntity> getInventory( ) throws Exception; @@ -124,7 +124,7 @@ ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) - ResponseEntity getOrderById( + @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("order_id") Long orderId ) throws Exception; @@ -157,7 +157,7 @@ ResponseEntity getOrderById( produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) - ResponseEntity placeOrder( + @Valid ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) throws Exception; diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/api/UserApi.java index 136e9b2e41c7..e766ab7b48ba 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/api/UserApi.java @@ -174,7 +174,7 @@ ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) - ResponseEntity getUserByName( + @Valid ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) throws Exception; @@ -207,7 +207,7 @@ ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) - ResponseEntity loginUser( + @Valid ResponseEntity loginUser( @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ) throws Exception; diff --git a/samples/server/petstore/springboot-api-response-examples/src/main/java/org/openapitools/api/DogsApi.java b/samples/server/petstore/springboot-api-response-examples/src/main/java/org/openapitools/api/DogsApi.java index f6e14d91ef6e..b5ce690e6ab2 100644 --- a/samples/server/petstore/springboot-api-response-examples/src/main/java/org/openapitools/api/DogsApi.java +++ b/samples/server/petstore/springboot-api-response-examples/src/main/java/org/openapitools/api/DogsApi.java @@ -80,7 +80,7 @@ default DogsApiDelegate getDelegate() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity createDog( + default @Valid ResponseEntity createDog( @Parameter(name = "Dog", description = "") @Valid @RequestBody(required = false) @Nullable Dog dog ) { return getDelegate().createDog(dog); diff --git a/samples/server/petstore/springboot-api-response-examples/src/main/java/org/openapitools/api/DogsApiDelegate.java b/samples/server/petstore/springboot-api-response-examples/src/main/java/org/openapitools/api/DogsApiDelegate.java index 5cadaf41edf2..ab5fa144d572 100644 --- a/samples/server/petstore/springboot-api-response-examples/src/main/java/org/openapitools/api/DogsApiDelegate.java +++ b/samples/server/petstore/springboot-api-response-examples/src/main/java/org/openapitools/api/DogsApiDelegate.java @@ -35,7 +35,7 @@ default Optional getRequest() { * or Bad Request (status code 400) * @see DogsApi#createDog */ - default ResponseEntity createDog(Dog dog) { + default @Valid ResponseEntity createDog(Dog dog) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java index c7d3b596ff27..359d1cb80252 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -67,7 +67,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity call123testSpecialTags( + default @Valid ResponseEntity call123testSpecialTags( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java index 23872c202a60..f6ed9d2e4017 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java @@ -109,7 +109,7 @@ default ResponseEntity createXmlItem( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterBooleanSerialize( + default @Valid ResponseEntity fakeOuterBooleanSerialize( @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) @Nullable Boolean body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -141,7 +141,7 @@ default ResponseEntity fakeOuterBooleanSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterCompositeSerialize( + default @Valid ResponseEntity fakeOuterCompositeSerialize( @Parameter(name = "OuterComposite", description = "Input composite as post body") @Valid @RequestBody(required = false) @Nullable OuterComposite outerComposite ) { getRequest().ifPresent(request -> { @@ -182,7 +182,7 @@ default ResponseEntity fakeOuterCompositeSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterNumberSerialize( + default @Valid ResponseEntity fakeOuterNumberSerialize( @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) @Nullable BigDecimal body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -214,7 +214,7 @@ default ResponseEntity fakeOuterNumberSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterStringSerialize( + default @Valid ResponseEntity fakeOuterStringSerialize( @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) @Nullable String body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -243,7 +243,7 @@ default ResponseEntity fakeOuterStringSerialize( value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) - default ResponseEntity responseObjectDifferentNames( + default @Valid ResponseEntity responseObjectDifferentNames( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { getRequest().ifPresent(request -> { @@ -343,7 +343,7 @@ default ResponseEntity testBodyWithQueryParams( produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClientModel( + default @Valid ResponseEntity testClientModel( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { @@ -654,7 +654,7 @@ default ResponseEntity testQueryParameterCollectionFormat( value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) - default ResponseEntity testWithResultExample( + default @Valid ResponseEntity testWithResultExample( ) { getRequest().ifPresent(request -> { @@ -701,7 +701,7 @@ default ResponseEntity testWithResultExample( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFileWithRequiredFile( + default @Valid ResponseEntity uploadFileWithRequiredFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index d276d199d029..41b703bf6839 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -70,7 +70,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClassname( + default @Valid ResponseEntity testClassname( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java index d3de9a3fc334..dfd71bb6623c 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java @@ -146,7 +146,7 @@ default ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus( + default @Valid ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) List status ) { getRequest().ifPresent(request -> { @@ -201,7 +201,7 @@ default ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags( + default @Valid ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) Set tags ) { getRequest().ifPresent(request -> { @@ -255,7 +255,7 @@ default ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById( + default @Valid ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { getRequest().ifPresent(request -> { @@ -383,7 +383,7 @@ default ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile( + default @Valid ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java index bb9732678b51..9ce26f80b655 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java @@ -100,7 +100,7 @@ default ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - default ResponseEntity> getInventory( + default @Valid ResponseEntity> getInventory( ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -137,7 +137,7 @@ default ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById( + default @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("order_id") Long orderId ) { getRequest().ifPresent(request -> { @@ -187,7 +187,7 @@ default ResponseEntity getOrderById( produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) - default ResponseEntity placeOrder( + default @Valid ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java index bf58d111c614..a848e02a8cf1 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java @@ -193,7 +193,7 @@ default ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName( + default @Valid ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { getRequest().ifPresent(request -> { @@ -243,7 +243,7 @@ default ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser( + default @Valid ResponseEntity loginUser( @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ) { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java index c7d3b596ff27..359d1cb80252 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -67,7 +67,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity call123testSpecialTags( + default @Valid ResponseEntity call123testSpecialTags( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java index 23872c202a60..f6ed9d2e4017 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java @@ -109,7 +109,7 @@ default ResponseEntity createXmlItem( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterBooleanSerialize( + default @Valid ResponseEntity fakeOuterBooleanSerialize( @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) @Nullable Boolean body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -141,7 +141,7 @@ default ResponseEntity fakeOuterBooleanSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterCompositeSerialize( + default @Valid ResponseEntity fakeOuterCompositeSerialize( @Parameter(name = "OuterComposite", description = "Input composite as post body") @Valid @RequestBody(required = false) @Nullable OuterComposite outerComposite ) { getRequest().ifPresent(request -> { @@ -182,7 +182,7 @@ default ResponseEntity fakeOuterCompositeSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterNumberSerialize( + default @Valid ResponseEntity fakeOuterNumberSerialize( @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) @Nullable BigDecimal body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -214,7 +214,7 @@ default ResponseEntity fakeOuterNumberSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterStringSerialize( + default @Valid ResponseEntity fakeOuterStringSerialize( @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) @Nullable String body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -243,7 +243,7 @@ default ResponseEntity fakeOuterStringSerialize( value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) - default ResponseEntity responseObjectDifferentNames( + default @Valid ResponseEntity responseObjectDifferentNames( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { getRequest().ifPresent(request -> { @@ -343,7 +343,7 @@ default ResponseEntity testBodyWithQueryParams( produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClientModel( + default @Valid ResponseEntity testClientModel( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { @@ -654,7 +654,7 @@ default ResponseEntity testQueryParameterCollectionFormat( value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) - default ResponseEntity testWithResultExample( + default @Valid ResponseEntity testWithResultExample( ) { getRequest().ifPresent(request -> { @@ -701,7 +701,7 @@ default ResponseEntity testWithResultExample( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFileWithRequiredFile( + default @Valid ResponseEntity uploadFileWithRequiredFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index d276d199d029..41b703bf6839 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -70,7 +70,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClassname( + default @Valid ResponseEntity testClassname( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java index d3de9a3fc334..dfd71bb6623c 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java @@ -146,7 +146,7 @@ default ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus( + default @Valid ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) List status ) { getRequest().ifPresent(request -> { @@ -201,7 +201,7 @@ default ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags( + default @Valid ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) Set tags ) { getRequest().ifPresent(request -> { @@ -255,7 +255,7 @@ default ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById( + default @Valid ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { getRequest().ifPresent(request -> { @@ -383,7 +383,7 @@ default ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile( + default @Valid ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java index bb9732678b51..9ce26f80b655 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java @@ -100,7 +100,7 @@ default ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - default ResponseEntity> getInventory( + default @Valid ResponseEntity> getInventory( ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -137,7 +137,7 @@ default ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById( + default @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("order_id") Long orderId ) { getRequest().ifPresent(request -> { @@ -187,7 +187,7 @@ default ResponseEntity getOrderById( produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) - default ResponseEntity placeOrder( + default @Valid ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java index bf58d111c614..a848e02a8cf1 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java @@ -193,7 +193,7 @@ default ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName( + default @Valid ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { getRequest().ifPresent(request -> { @@ -243,7 +243,7 @@ default ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser( + default @Valid ResponseEntity loginUser( @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ) { diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/AnotherFakeApi.java index c18352b09cf9..964f5eee4588 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -67,7 +67,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity call123testSpecialTags( + default @Valid ResponseEntity call123testSpecialTags( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/FakeApi.java index 8583cb5ea432..eda436b51d9d 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/FakeApi.java @@ -109,7 +109,7 @@ default ResponseEntity createXmlItem( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterBooleanSerialize( + default @Valid ResponseEntity fakeOuterBooleanSerialize( @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) @Nullable Boolean body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -141,7 +141,7 @@ default ResponseEntity fakeOuterBooleanSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterCompositeSerialize( + default @Valid ResponseEntity fakeOuterCompositeSerialize( @Parameter(name = "OuterComposite", description = "Input composite as post body") @Valid @RequestBody(required = false) @Nullable OuterComposite outerComposite ) { getRequest().ifPresent(request -> { @@ -182,7 +182,7 @@ default ResponseEntity fakeOuterCompositeSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterNumberSerialize( + default @Valid ResponseEntity fakeOuterNumberSerialize( @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) @Nullable BigDecimal body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -214,7 +214,7 @@ default ResponseEntity fakeOuterNumberSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterStringSerialize( + default @Valid ResponseEntity fakeOuterStringSerialize( @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) @Nullable String body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -243,7 +243,7 @@ default ResponseEntity fakeOuterStringSerialize( value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) - default ResponseEntity responseObjectDifferentNames( + default @Valid ResponseEntity responseObjectDifferentNames( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { getRequest().ifPresent(request -> { @@ -343,7 +343,7 @@ default ResponseEntity testBodyWithQueryParams( produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClientModel( + default @Valid ResponseEntity testClientModel( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { @@ -654,7 +654,7 @@ default ResponseEntity testQueryParameterCollectionFormat( value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) - default ResponseEntity testWithResultExample( + default @Valid ResponseEntity testWithResultExample( ) { getRequest().ifPresent(request -> { @@ -701,7 +701,7 @@ default ResponseEntity testWithResultExample( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFileWithRequiredFile( + default @Valid ResponseEntity uploadFileWithRequiredFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 02d1247016ad..a4483f5d46e2 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -70,7 +70,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClassname( + default @Valid ResponseEntity testClassname( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/PetApi.java index c829fa322d2a..815180162ca1 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/PetApi.java @@ -146,7 +146,7 @@ default ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus( + default @Valid ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) List status ) { getRequest().ifPresent(request -> { @@ -201,7 +201,7 @@ default ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags( + default @Valid ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) Set tags ) { getRequest().ifPresent(request -> { @@ -255,7 +255,7 @@ default ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById( + default @Valid ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { getRequest().ifPresent(request -> { @@ -383,7 +383,7 @@ default ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile( + default @Valid ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/StoreApi.java index 27f11968d498..3eae1a08657f 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/StoreApi.java @@ -100,7 +100,7 @@ default ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - default ResponseEntity> getInventory( + default @Valid ResponseEntity> getInventory( ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -137,7 +137,7 @@ default ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById( + default @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("order_id") Long orderId ) { getRequest().ifPresent(request -> { @@ -187,7 +187,7 @@ default ResponseEntity getOrderById( produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) - default ResponseEntity placeOrder( + default @Valid ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/UserApi.java index 8811b3c95e0f..a76f2a67b76f 100644 --- a/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-builtin-validation/src/main/java/org/openapitools/api/UserApi.java @@ -193,7 +193,7 @@ default ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName( + default @Valid ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { getRequest().ifPresent(request -> { @@ -243,7 +243,7 @@ default ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser( + default @Valid ResponseEntity loginUser( @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ) { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index 9b57d7a450b0..936821c06a41 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -63,7 +63,7 @@ default AnotherFakeApiDelegate getDelegate() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity call123testSpecialTags( + default @Valid ResponseEntity call123testSpecialTags( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { return getDelegate().call123testSpecialTags(client); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java index 14f4311445e8..53c305fa243d 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java @@ -33,7 +33,7 @@ default Optional getRequest() { * @return successful operation (status code 200) * @see AnotherFakeApi#call123testSpecialTags */ - default ResponseEntity call123testSpecialTags(Client client) { + default @Valid ResponseEntity call123testSpecialTags(Client client) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java index ac38d236b8c5..3de79e5df18c 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -104,7 +104,7 @@ default ResponseEntity createXmlItem( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterBooleanSerialize( + default @Valid ResponseEntity fakeOuterBooleanSerialize( @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) @Nullable Boolean body ) { return getDelegate().fakeOuterBooleanSerialize(body); @@ -135,7 +135,7 @@ default ResponseEntity fakeOuterBooleanSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterCompositeSerialize( + default @Valid ResponseEntity fakeOuterCompositeSerialize( @Parameter(name = "OuterComposite", description = "Input composite as post body") @Valid @RequestBody(required = false) @Nullable OuterComposite outerComposite ) { return getDelegate().fakeOuterCompositeSerialize(outerComposite); @@ -166,7 +166,7 @@ default ResponseEntity fakeOuterCompositeSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterNumberSerialize( + default @Valid ResponseEntity fakeOuterNumberSerialize( @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) @Nullable BigDecimal body ) { return getDelegate().fakeOuterNumberSerialize(body); @@ -197,7 +197,7 @@ default ResponseEntity fakeOuterNumberSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterStringSerialize( + default @Valid ResponseEntity fakeOuterStringSerialize( @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) @Nullable String body ) { return getDelegate().fakeOuterStringSerialize(body); @@ -225,7 +225,7 @@ default ResponseEntity fakeOuterStringSerialize( value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) - default ResponseEntity responseObjectDifferentNames( + default @Valid ResponseEntity responseObjectDifferentNames( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { return getDelegate().responseObjectDifferentNames(petId); @@ -313,7 +313,7 @@ default ResponseEntity testBodyWithQueryParams( produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClientModel( + default @Valid ResponseEntity testClientModel( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { return getDelegate().testClientModel(client); @@ -607,7 +607,7 @@ default ResponseEntity testQueryParameterCollectionFormat( value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) - default ResponseEntity testWithResultExample( + default @Valid ResponseEntity testWithResultExample( ) { return getDelegate().testWithResultExample(); @@ -644,7 +644,7 @@ default ResponseEntity testWithResultExample( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFileWithRequiredFile( + default @Valid ResponseEntity uploadFileWithRequiredFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java index e1e5fd5a8305..77253fbbe4a5 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -59,7 +59,7 @@ default ResponseEntity createXmlItem(XmlItem xmlItem) { * @return Output boolean (status code 200) * @see FakeApi#fakeOuterBooleanSerialize */ - default ResponseEntity fakeOuterBooleanSerialize(Boolean body) { + default @Valid ResponseEntity fakeOuterBooleanSerialize(Boolean body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -72,7 +72,7 @@ default ResponseEntity fakeOuterBooleanSerialize(Boolean body) { * @return Output composite (status code 200) * @see FakeApi#fakeOuterCompositeSerialize */ - default ResponseEntity fakeOuterCompositeSerialize(OuterComposite outerComposite) { + default @Valid ResponseEntity fakeOuterCompositeSerialize(OuterComposite outerComposite) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { @@ -94,7 +94,7 @@ default ResponseEntity fakeOuterCompositeSerialize(OuterComposit * @return Output number (status code 200) * @see FakeApi#fakeOuterNumberSerialize */ - default ResponseEntity fakeOuterNumberSerialize(BigDecimal body) { + default @Valid ResponseEntity fakeOuterNumberSerialize(BigDecimal body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -107,7 +107,7 @@ default ResponseEntity fakeOuterNumberSerialize(BigDecimal body) { * @return Output string (status code 200) * @see FakeApi#fakeOuterStringSerialize */ - default ResponseEntity fakeOuterStringSerialize(String body) { + default @Valid ResponseEntity fakeOuterStringSerialize(String body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -119,7 +119,7 @@ default ResponseEntity fakeOuterStringSerialize(String body) { * @return successful operation (status code 200) * @see FakeApi#responseObjectDifferentNames */ - default ResponseEntity responseObjectDifferentNames(Long petId) { + default @Valid ResponseEntity responseObjectDifferentNames(Long petId) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -168,7 +168,7 @@ default ResponseEntity testBodyWithQueryParams(String query, * @return successful operation (status code 200) * @see FakeApi#testClientModel */ - default ResponseEntity testClientModel(Client client) { + default @Valid ResponseEntity testClientModel(Client client) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -340,7 +340,7 @@ default ResponseEntity testQueryParameterCollectionFormat(List pip * @return Success (status code 200) * @see FakeApi#testWithResultExample */ - default ResponseEntity testWithResultExample() { + default @Valid ResponseEntity testWithResultExample() { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -364,7 +364,7 @@ default ResponseEntity testWithResultExample() { * @return successful operation (status code 200) * @see FakeApi#uploadFileWithRequiredFile */ - default ResponseEntity uploadFileWithRequiredFile(Long petId, + default @Valid ResponseEntity uploadFileWithRequiredFile(Long petId, MultipartFile requiredFile, String additionalMetadata) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 1af7a821e465..0aed831719f9 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -66,7 +66,7 @@ default FakeClassnameTestApiDelegate getDelegate() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClassname( + default @Valid ResponseEntity testClassname( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { return getDelegate().testClassname(client); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java index 376433f1fd53..af53d7a0ec50 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java @@ -33,7 +33,7 @@ default Optional getRequest() { * @return successful operation (status code 200) * @see FakeClassnameTestApi#testClassname */ - default ResponseEntity testClassname(Client client) { + default @Valid ResponseEntity testClassname(Client client) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java index dd52990f5897..ff38f5fcc6da 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java @@ -140,7 +140,7 @@ default ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus( + default @Valid ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) List status ) { return getDelegate().findPetsByStatus(status); @@ -180,7 +180,7 @@ default ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags( + default @Valid ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) Set tags ) { return getDelegate().findPetsByTags(tags); @@ -219,7 +219,7 @@ default ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById( + default @Valid ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { return getDelegate().getPetById(petId); @@ -330,7 +330,7 @@ default ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile( + default @Valid ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiDelegate.java index 085a27846c24..f79325e13113 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -67,7 +67,7 @@ default ResponseEntity deletePet(Long petId, * or Invalid status value (status code 400) * @see PetApi#findPetsByStatus */ - default ResponseEntity> findPetsByStatus(List status) { + default @Valid ResponseEntity> findPetsByStatus(List status) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -97,7 +97,7 @@ default ResponseEntity> findPetsByStatus(List status) { * @see PetApi#findPetsByTags */ @Deprecated - default ResponseEntity> findPetsByTags(Set tags) { + default @Valid ResponseEntity> findPetsByTags(Set tags) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -126,7 +126,7 @@ default ResponseEntity> findPetsByTags(Set tags) { * or Pet not found (status code 404) * @see PetApi#getPetById */ - default ResponseEntity getPetById(Long petId) { + default @Valid ResponseEntity getPetById(Long petId) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -188,7 +188,7 @@ default ResponseEntity updatePetWithForm(Long petId, * @return successful operation (status code 200) * @see PetApi#uploadFile */ - default ResponseEntity uploadFile(Long petId, + default @Valid ResponseEntity uploadFile(Long petId, String additionalMetadata, MultipartFile file) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java index b87690ad9bdd..0cb4a880d9dd 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java @@ -95,7 +95,7 @@ default ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - default ResponseEntity> getInventory( + default @Valid ResponseEntity> getInventory( ) { return getDelegate().getInventory(); @@ -131,7 +131,7 @@ default ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById( + default @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("order_id") Long orderId ) { return getDelegate().getOrderById(orderId); @@ -166,7 +166,7 @@ default ResponseEntity getOrderById( produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) - default ResponseEntity placeOrder( + default @Valid ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { return getDelegate().placeOrder(order); diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiDelegate.java index 0beabb5b845c..79d1a9a9c26e 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiDelegate.java @@ -47,7 +47,7 @@ default ResponseEntity deleteOrder(String orderId) { * @return successful operation (status code 200) * @see StoreApi#getInventory */ - default ResponseEntity> getInventory() { + default @Valid ResponseEntity> getInventory() { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -62,7 +62,7 @@ default ResponseEntity> getInventory() { * or Order not found (status code 404) * @see StoreApi#getOrderById */ - default ResponseEntity getOrderById(Long orderId) { + default @Valid ResponseEntity getOrderById(Long orderId) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -90,7 +90,7 @@ default ResponseEntity getOrderById(Long orderId) { * or Invalid Order (status code 400) * @see StoreApi#placeOrder */ - default ResponseEntity placeOrder(Order order) { + default @Valid ResponseEntity placeOrder(Order order) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java index 6ec40fa05eb5..9f5257331595 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java @@ -185,7 +185,7 @@ default ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName( + default @Valid ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { return getDelegate().getUserByName(username); @@ -220,7 +220,7 @@ default ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser( + default @Valid ResponseEntity loginUser( @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ) { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiDelegate.java index e9c84c0901f2..71a53fc34ef9 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -89,7 +89,7 @@ default ResponseEntity deleteUser(String username) { * or User not found (status code 404) * @see UserApi#getUserByName */ - default ResponseEntity getUserByName(String username) { + default @Valid ResponseEntity getUserByName(String username) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -118,7 +118,7 @@ default ResponseEntity getUserByName(String username) { * or Invalid username/password supplied (status code 400) * @see UserApi#loginUser */ - default ResponseEntity loginUser(String username, + default @Valid ResponseEntity loginUser(String username, String password) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/PetApi.java index 282139926acd..eb9fb526a1e6 100644 --- a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/PetApi.java @@ -72,7 +72,7 @@ default PetApiDelegate getDelegate() { consumes = { "application/json", "application/xml" } ) @ResponseStatus(HttpStatus.OK) - default Pet addPet( + default @Valid Pet addPet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { return getDelegate().addPet(pet); @@ -144,7 +144,7 @@ default void deletePet( produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) - default List findPetsByStatus( + default @Valid List<@Valid Pet> findPetsByStatus( @NotNull @Parameter(name = "status", deprecated = true, description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) @Deprecated List status ) { return getDelegate().findPetsByStatus(status); @@ -185,7 +185,7 @@ default List findPetsByStatus( produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) - default List findPetsByTags( + default @Valid List<@Valid Pet> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) List tags ) { return getDelegate().findPetsByTags(tags); @@ -225,7 +225,7 @@ default List findPetsByTags( produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) - default Pet getPetById( + default @Valid Pet getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { return getDelegate().getPetById(petId); @@ -271,7 +271,7 @@ default Pet getPetById( consumes = { "application/json", "application/xml" } ) @ResponseStatus(HttpStatus.OK) - default Pet updatePet( + default @Valid Pet updatePet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { return getDelegate().updatePet(pet); @@ -346,7 +346,7 @@ default void updatePetWithForm( consumes = { "multipart/form-data" } ) @ResponseStatus(HttpStatus.OK) - default ModelApiResponse uploadFile( + default @Valid ModelApiResponse uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/PetApiDelegate.java index e5cf4bd92b1d..1e691edab362 100644 --- a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -35,7 +35,7 @@ default Optional getRequest() { * or Invalid input (status code 405) * @see PetApi#addPet */ - default Pet addPet(Pet pet) { + default @Valid Pet addPet(Pet pet) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -78,7 +78,7 @@ default void deletePet(Long petId, * or Invalid status value (status code 400) * @see PetApi#findPetsByStatus */ - default List findPetsByStatus(List status) { + default @Valid List<@Valid Pet> findPetsByStatus(List status) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -108,7 +108,7 @@ default List findPetsByStatus(List status) { * @see PetApi#findPetsByTags */ @Deprecated - default List findPetsByTags(List tags) { + default @Valid List<@Valid Pet> findPetsByTags(List tags) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -137,7 +137,7 @@ default List findPetsByTags(List tags) { * or Pet not found (status code 404) * @see PetApi#getPetById */ - default Pet getPetById(Long petId) { + default @Valid Pet getPetById(Long petId) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -169,7 +169,7 @@ default Pet getPetById(Long petId) { * @see Update an existing pet Documentation * @see PetApi#updatePet */ - default Pet updatePet(Pet pet) { + default @Valid Pet updatePet(Pet pet) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -215,7 +215,7 @@ default void updatePetWithForm(Long petId, * @return successful operation (status code 200) * @see PetApi#uploadFile */ - default ModelApiResponse uploadFile(Long petId, + default @Valid ModelApiResponse uploadFile(Long petId, String additionalMetadata, MultipartFile file) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/StoreApi.java index 4c0712024ab5..fbcbdafdae6d 100644 --- a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/StoreApi.java @@ -97,7 +97,7 @@ default void deleteOrder( produces = { "application/json" } ) @ResponseStatus(HttpStatus.OK) - default Map getInventory( + default @Valid Map getInventory( ) { return getDelegate().getInventory(); @@ -134,7 +134,7 @@ default Map getInventory( produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) - default Order getOrderById( + default @Valid Order getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId ) { return getDelegate().getOrderById(orderId); @@ -170,7 +170,7 @@ default Order getOrderById( consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) - default Order placeOrder( + default @Valid Order placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { return getDelegate().placeOrder(order); diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/StoreApiDelegate.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/StoreApiDelegate.java index a1ed42001903..5bea4d5d62df 100644 --- a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/StoreApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/StoreApiDelegate.java @@ -46,7 +46,7 @@ default void deleteOrder(String orderId) { * @return successful operation (status code 200) * @see StoreApi#getInventory */ - default Map getInventory() { + default @Valid Map getInventory() { throw new IllegalArgumentException("Not implemented"); } @@ -61,7 +61,7 @@ default Map getInventory() { * or Order not found (status code 404) * @see StoreApi#getOrderById */ - default Order getOrderById(Long orderId) { + default @Valid Order getOrderById(Long orderId) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -89,7 +89,7 @@ default Order getOrderById(Long orderId) { * or Invalid Order (status code 400) * @see StoreApi#placeOrder */ - default Order placeOrder(Order order) { + default @Valid Order placeOrder(Order order) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/UserApi.java index 1635faa88a41..81a20863e9e8 100644 --- a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/UserApi.java @@ -202,7 +202,7 @@ default void deleteUser( produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) - default User getUserByName( + default @Valid User getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { return getDelegate().getUserByName(username); @@ -238,7 +238,7 @@ default User getUserByName( produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) - default String loginUser( + default @Valid String loginUser( @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ) { diff --git a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/UserApiDelegate.java index 9cb61bdca860..0a7012d1f4f0 100644 --- a/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-no-response-entity/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -88,7 +88,7 @@ default void deleteUser(String username) { * or User not found (status code 404) * @see UserApi#getUserByName */ - default User getUserByName(String username) { + default @Valid User getUserByName(String username) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -117,7 +117,7 @@ default User getUserByName(String username) { * or Invalid username/password supplied (status code 400) * @see UserApi#loginUser */ - default String loginUser(String username, + default @Valid String loginUser(String username, String password) { throw new IllegalArgumentException("Not implemented"); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java index 9b57d7a450b0..936821c06a41 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -63,7 +63,7 @@ default AnotherFakeApiDelegate getDelegate() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity call123testSpecialTags( + default @Valid ResponseEntity call123testSpecialTags( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { return getDelegate().call123testSpecialTags(client); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java index 14f4311445e8..53c305fa243d 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java @@ -33,7 +33,7 @@ default Optional getRequest() { * @return successful operation (status code 200) * @see AnotherFakeApi#call123testSpecialTags */ - default ResponseEntity call123testSpecialTags(Client client) { + default @Valid ResponseEntity call123testSpecialTags(Client client) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java index ac38d236b8c5..3de79e5df18c 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java @@ -104,7 +104,7 @@ default ResponseEntity createXmlItem( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterBooleanSerialize( + default @Valid ResponseEntity fakeOuterBooleanSerialize( @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) @Nullable Boolean body ) { return getDelegate().fakeOuterBooleanSerialize(body); @@ -135,7 +135,7 @@ default ResponseEntity fakeOuterBooleanSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterCompositeSerialize( + default @Valid ResponseEntity fakeOuterCompositeSerialize( @Parameter(name = "OuterComposite", description = "Input composite as post body") @Valid @RequestBody(required = false) @Nullable OuterComposite outerComposite ) { return getDelegate().fakeOuterCompositeSerialize(outerComposite); @@ -166,7 +166,7 @@ default ResponseEntity fakeOuterCompositeSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterNumberSerialize( + default @Valid ResponseEntity fakeOuterNumberSerialize( @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) @Nullable BigDecimal body ) { return getDelegate().fakeOuterNumberSerialize(body); @@ -197,7 +197,7 @@ default ResponseEntity fakeOuterNumberSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterStringSerialize( + default @Valid ResponseEntity fakeOuterStringSerialize( @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) @Nullable String body ) { return getDelegate().fakeOuterStringSerialize(body); @@ -225,7 +225,7 @@ default ResponseEntity fakeOuterStringSerialize( value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) - default ResponseEntity responseObjectDifferentNames( + default @Valid ResponseEntity responseObjectDifferentNames( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { return getDelegate().responseObjectDifferentNames(petId); @@ -313,7 +313,7 @@ default ResponseEntity testBodyWithQueryParams( produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClientModel( + default @Valid ResponseEntity testClientModel( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { return getDelegate().testClientModel(client); @@ -607,7 +607,7 @@ default ResponseEntity testQueryParameterCollectionFormat( value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) - default ResponseEntity testWithResultExample( + default @Valid ResponseEntity testWithResultExample( ) { return getDelegate().testWithResultExample(); @@ -644,7 +644,7 @@ default ResponseEntity testWithResultExample( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFileWithRequiredFile( + default @Valid ResponseEntity uploadFileWithRequiredFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java index e1e5fd5a8305..77253fbbe4a5 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -59,7 +59,7 @@ default ResponseEntity createXmlItem(XmlItem xmlItem) { * @return Output boolean (status code 200) * @see FakeApi#fakeOuterBooleanSerialize */ - default ResponseEntity fakeOuterBooleanSerialize(Boolean body) { + default @Valid ResponseEntity fakeOuterBooleanSerialize(Boolean body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -72,7 +72,7 @@ default ResponseEntity fakeOuterBooleanSerialize(Boolean body) { * @return Output composite (status code 200) * @see FakeApi#fakeOuterCompositeSerialize */ - default ResponseEntity fakeOuterCompositeSerialize(OuterComposite outerComposite) { + default @Valid ResponseEntity fakeOuterCompositeSerialize(OuterComposite outerComposite) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { @@ -94,7 +94,7 @@ default ResponseEntity fakeOuterCompositeSerialize(OuterComposit * @return Output number (status code 200) * @see FakeApi#fakeOuterNumberSerialize */ - default ResponseEntity fakeOuterNumberSerialize(BigDecimal body) { + default @Valid ResponseEntity fakeOuterNumberSerialize(BigDecimal body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -107,7 +107,7 @@ default ResponseEntity fakeOuterNumberSerialize(BigDecimal body) { * @return Output string (status code 200) * @see FakeApi#fakeOuterStringSerialize */ - default ResponseEntity fakeOuterStringSerialize(String body) { + default @Valid ResponseEntity fakeOuterStringSerialize(String body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -119,7 +119,7 @@ default ResponseEntity fakeOuterStringSerialize(String body) { * @return successful operation (status code 200) * @see FakeApi#responseObjectDifferentNames */ - default ResponseEntity responseObjectDifferentNames(Long petId) { + default @Valid ResponseEntity responseObjectDifferentNames(Long petId) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -168,7 +168,7 @@ default ResponseEntity testBodyWithQueryParams(String query, * @return successful operation (status code 200) * @see FakeApi#testClientModel */ - default ResponseEntity testClientModel(Client client) { + default @Valid ResponseEntity testClientModel(Client client) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -340,7 +340,7 @@ default ResponseEntity testQueryParameterCollectionFormat(List pip * @return Success (status code 200) * @see FakeApi#testWithResultExample */ - default ResponseEntity testWithResultExample() { + default @Valid ResponseEntity testWithResultExample() { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -364,7 +364,7 @@ default ResponseEntity testWithResultExample() { * @return successful operation (status code 200) * @see FakeApi#uploadFileWithRequiredFile */ - default ResponseEntity uploadFileWithRequiredFile(Long petId, + default @Valid ResponseEntity uploadFileWithRequiredFile(Long petId, MultipartFile requiredFile, String additionalMetadata) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 1af7a821e465..0aed831719f9 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -66,7 +66,7 @@ default FakeClassnameTestApiDelegate getDelegate() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClassname( + default @Valid ResponseEntity testClassname( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { return getDelegate().testClassname(client); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java index 376433f1fd53..af53d7a0ec50 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java @@ -33,7 +33,7 @@ default Optional getRequest() { * @return successful operation (status code 200) * @see FakeClassnameTestApi#testClassname */ - default ResponseEntity testClassname(Client client) { + default @Valid ResponseEntity testClassname(Client client) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java index dd52990f5897..ff38f5fcc6da 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java @@ -140,7 +140,7 @@ default ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus( + default @Valid ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) List status ) { return getDelegate().findPetsByStatus(status); @@ -180,7 +180,7 @@ default ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags( + default @Valid ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) Set tags ) { return getDelegate().findPetsByTags(tags); @@ -219,7 +219,7 @@ default ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById( + default @Valid ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { return getDelegate().getPetById(petId); @@ -330,7 +330,7 @@ default ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile( + default @Valid ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java index 085a27846c24..f79325e13113 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -67,7 +67,7 @@ default ResponseEntity deletePet(Long petId, * or Invalid status value (status code 400) * @see PetApi#findPetsByStatus */ - default ResponseEntity> findPetsByStatus(List status) { + default @Valid ResponseEntity> findPetsByStatus(List status) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -97,7 +97,7 @@ default ResponseEntity> findPetsByStatus(List status) { * @see PetApi#findPetsByTags */ @Deprecated - default ResponseEntity> findPetsByTags(Set tags) { + default @Valid ResponseEntity> findPetsByTags(Set tags) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -126,7 +126,7 @@ default ResponseEntity> findPetsByTags(Set tags) { * or Pet not found (status code 404) * @see PetApi#getPetById */ - default ResponseEntity getPetById(Long petId) { + default @Valid ResponseEntity getPetById(Long petId) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -188,7 +188,7 @@ default ResponseEntity updatePetWithForm(Long petId, * @return successful operation (status code 200) * @see PetApi#uploadFile */ - default ResponseEntity uploadFile(Long petId, + default @Valid ResponseEntity uploadFile(Long petId, String additionalMetadata, MultipartFile file) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java index b87690ad9bdd..0cb4a880d9dd 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java @@ -95,7 +95,7 @@ default ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - default ResponseEntity> getInventory( + default @Valid ResponseEntity> getInventory( ) { return getDelegate().getInventory(); @@ -131,7 +131,7 @@ default ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById( + default @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("order_id") Long orderId ) { return getDelegate().getOrderById(orderId); @@ -166,7 +166,7 @@ default ResponseEntity getOrderById( produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) - default ResponseEntity placeOrder( + default @Valid ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { return getDelegate().placeOrder(order); diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiDelegate.java index 0beabb5b845c..79d1a9a9c26e 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiDelegate.java @@ -47,7 +47,7 @@ default ResponseEntity deleteOrder(String orderId) { * @return successful operation (status code 200) * @see StoreApi#getInventory */ - default ResponseEntity> getInventory() { + default @Valid ResponseEntity> getInventory() { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -62,7 +62,7 @@ default ResponseEntity> getInventory() { * or Order not found (status code 404) * @see StoreApi#getOrderById */ - default ResponseEntity getOrderById(Long orderId) { + default @Valid ResponseEntity getOrderById(Long orderId) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -90,7 +90,7 @@ default ResponseEntity getOrderById(Long orderId) { * or Invalid Order (status code 400) * @see StoreApi#placeOrder */ - default ResponseEntity placeOrder(Order order) { + default @Valid ResponseEntity placeOrder(Order order) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java index 6ec40fa05eb5..9f5257331595 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java @@ -185,7 +185,7 @@ default ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName( + default @Valid ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { return getDelegate().getUserByName(username); @@ -220,7 +220,7 @@ default ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser( + default @Valid ResponseEntity loginUser( @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ) { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java index e9c84c0901f2..71a53fc34ef9 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -89,7 +89,7 @@ default ResponseEntity deleteUser(String username) { * or User not found (status code 404) * @see UserApi#getUserByName */ - default ResponseEntity getUserByName(String username) { + default @Valid ResponseEntity getUserByName(String username) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -118,7 +118,7 @@ default ResponseEntity getUserByName(String username) { * or Invalid username/password supplied (status code 400) * @see UserApi#loginUser */ - default ResponseEntity loginUser(String username, + default @Valid ResponseEntity loginUser(String username, String password) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/PetApi.java index aabaa29ca05f..0927b1cd3ca4 100644 --- a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/PetApi.java @@ -46,7 +46,7 @@ default Optional getRequest() { produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) - default ResponseEntity addPet( + default @Valid ResponseEntity addPet( @Valid @RequestBody Pet pet ) { getRequest().ifPresent(request -> { @@ -102,7 +102,7 @@ default ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus( + default @Valid ResponseEntity> findPetsByStatus( @NotNull @RequestParam(value = "status", required = true) @Deprecated List status ) { getRequest().ifPresent(request -> { @@ -140,7 +140,7 @@ default ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags( + default @Valid ResponseEntity> findPetsByTags( @NotNull @RequestParam(value = "tags", required = true) List tags ) { getRequest().ifPresent(request -> { @@ -177,7 +177,7 @@ default ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById( + default @Valid ResponseEntity getPetById( @PathVariable("petId") Long petId ) { getRequest().ifPresent(request -> { @@ -218,7 +218,7 @@ default ResponseEntity getPetById( produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) - default ResponseEntity updatePet( + default @Valid ResponseEntity updatePet( @Valid @RequestBody Pet pet ) { getRequest().ifPresent(request -> { @@ -281,7 +281,7 @@ default ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile( + default @Valid ResponseEntity uploadFile( @PathVariable("petId") Long petId, @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/StoreApi.java index 083102c8532c..77a8bd5ac230 100644 --- a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/StoreApi.java @@ -63,7 +63,7 @@ default ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - default ResponseEntity> getInventory( + default @Valid ResponseEntity> getInventory( ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -86,7 +86,7 @@ default ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById( + default @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @PathVariable("orderId") Long orderId ) { getRequest().ifPresent(request -> { @@ -123,7 +123,7 @@ default ResponseEntity getOrderById( produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) - default ResponseEntity placeOrder( + default @Valid ResponseEntity placeOrder( @Valid @RequestBody Order order ) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/UserApi.java index 68c5e9a7d1c2..b8fedcf305cf 100644 --- a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/api/UserApi.java @@ -129,7 +129,7 @@ default ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName( + default @Valid ResponseEntity getUserByName( @PathVariable("username") String username ) { getRequest().ifPresent(request -> { @@ -166,7 +166,7 @@ default ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser( + default @Valid ResponseEntity loginUser( @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Valid @RequestParam(value = "password", required = true) String password ) { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java index a7df9e3e653c..5fb3ec4e4001 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -67,7 +67,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity call123testSpecialTags( + default @Valid ResponseEntity call123testSpecialTags( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java index 0406bbe47ff5..d1983bd3e196 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java @@ -109,7 +109,7 @@ default ResponseEntity createXmlItem( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterBooleanSerialize( + default @Valid ResponseEntity fakeOuterBooleanSerialize( @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) @Nullable Boolean body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -141,7 +141,7 @@ default ResponseEntity fakeOuterBooleanSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterCompositeSerialize( + default @Valid ResponseEntity fakeOuterCompositeSerialize( @Parameter(name = "OuterComposite", description = "Input composite as post body") @Valid @RequestBody(required = false) @Nullable OuterComposite outerComposite ) { getRequest().ifPresent(request -> { @@ -182,7 +182,7 @@ default ResponseEntity fakeOuterCompositeSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterNumberSerialize( + default @Valid ResponseEntity fakeOuterNumberSerialize( @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) @Nullable BigDecimal body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -214,7 +214,7 @@ default ResponseEntity fakeOuterNumberSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterStringSerialize( + default @Valid ResponseEntity fakeOuterStringSerialize( @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) @Nullable String body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -243,7 +243,7 @@ default ResponseEntity fakeOuterStringSerialize( value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) - default ResponseEntity responseObjectDifferentNames( + default @Valid ResponseEntity responseObjectDifferentNames( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { getRequest().ifPresent(request -> { @@ -343,7 +343,7 @@ default ResponseEntity testBodyWithQueryParams( produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClientModel( + default @Valid ResponseEntity testClientModel( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { @@ -654,7 +654,7 @@ default ResponseEntity testQueryParameterCollectionFormat( value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) - default ResponseEntity testWithResultExample( + default @Valid ResponseEntity testWithResultExample( ) { getRequest().ifPresent(request -> { @@ -701,7 +701,7 @@ default ResponseEntity testWithResultExample( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFileWithRequiredFile( + default @Valid ResponseEntity uploadFileWithRequiredFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 2d8f446ccf7f..39833e451137 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -70,7 +70,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClassname( + default @Valid ResponseEntity testClassname( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java index 97a48a138121..7f5305dbb024 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java @@ -147,7 +147,7 @@ default ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus( + default @Valid ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) List status ) { getRequest().ifPresent(request -> { @@ -202,7 +202,7 @@ default ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags( + default @Valid ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) Set tags ) { getRequest().ifPresent(request -> { @@ -256,7 +256,7 @@ default ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById( + default @Valid ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { getRequest().ifPresent(request -> { @@ -384,7 +384,7 @@ default ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile( + default @Valid ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java index 4bb9fe0c1e2a..1e500b73f288 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java @@ -100,7 +100,7 @@ default ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - default ResponseEntity> getInventory( + default @Valid ResponseEntity> getInventory( ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -137,7 +137,7 @@ default ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById( + default @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("order_id") Long orderId ) { getRequest().ifPresent(request -> { @@ -187,7 +187,7 @@ default ResponseEntity getOrderById( produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) - default ResponseEntity placeOrder( + default @Valid ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java index 65cd19e69fdf..02cdbbbd8322 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java @@ -193,7 +193,7 @@ default ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName( + default @Valid ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { getRequest().ifPresent(request -> { @@ -243,7 +243,7 @@ default ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser( + default @Valid ResponseEntity loginUser( @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ) { diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/AnotherFakeApi.java index 4610f3cbd4df..c9a5bf4a42d5 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -68,7 +68,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity call123testSpecialTags( + default @Valid ResponseEntity call123testSpecialTags( @Parameter(name = "ClientDto", description = "client model", required = true) @Valid @RequestBody ClientDto clientDto, @Parameter(hidden = true) final HttpServletRequest servletRequest ) { diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/FakeApi.java index 0d357a1429fb..3c9e0fbb0267 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/FakeApi.java @@ -111,7 +111,7 @@ default ResponseEntity createXmlItem( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterBooleanSerialize( + default @Valid ResponseEntity fakeOuterBooleanSerialize( @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) @Nullable Boolean body, @Parameter(hidden = true) final HttpServletRequest servletRequest ) { @@ -144,7 +144,7 @@ default ResponseEntity fakeOuterBooleanSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterCompositeSerialize( + default @Valid ResponseEntity fakeOuterCompositeSerialize( @Parameter(name = "OuterCompositeDto", description = "Input composite as post body") @Valid @RequestBody(required = false) @Nullable OuterCompositeDto outerCompositeDto, @Parameter(hidden = true) final HttpServletRequest servletRequest ) { @@ -186,7 +186,7 @@ default ResponseEntity fakeOuterCompositeSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterNumberSerialize( + default @Valid ResponseEntity fakeOuterNumberSerialize( @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) @Nullable BigDecimal body, @Parameter(hidden = true) final HttpServletRequest servletRequest ) { @@ -219,7 +219,7 @@ default ResponseEntity fakeOuterNumberSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterStringSerialize( + default @Valid ResponseEntity fakeOuterStringSerialize( @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) @Nullable String body, @Parameter(hidden = true) final HttpServletRequest servletRequest ) { @@ -249,7 +249,7 @@ default ResponseEntity fakeOuterStringSerialize( value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) - default ResponseEntity responseObjectDifferentNames( + default @Valid ResponseEntity responseObjectDifferentNames( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(hidden = true) final HttpServletRequest servletRequest ) { @@ -352,7 +352,7 @@ default ResponseEntity testBodyWithQueryParams( produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClientModel( + default @Valid ResponseEntity testClientModel( @Parameter(name = "ClientDto", description = "client model", required = true) @Valid @RequestBody ClientDto clientDto, @Parameter(hidden = true) final HttpServletRequest servletRequest ) { @@ -671,7 +671,7 @@ default ResponseEntity testQueryParameterCollectionFormat( value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) - default ResponseEntity testWithResultExample( + default @Valid ResponseEntity testWithResultExample( @Parameter(hidden = true) final HttpServletRequest servletRequest ) { getRequest().ifPresent(request -> { @@ -718,7 +718,7 @@ default ResponseEntity testWithResultExample( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFileWithRequiredFile( + default @Valid ResponseEntity uploadFileWithRequiredFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 12be7df07f2a..c6a0476301ba 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -71,7 +71,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClassname( + default @Valid ResponseEntity testClassname( @Parameter(name = "ClientDto", description = "client model", required = true) @Valid @RequestBody ClientDto clientDto, @Parameter(hidden = true) final HttpServletRequest servletRequest ) { diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/PetApi.java index b4145f7b04a0..c5cbb2883f98 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/PetApi.java @@ -149,7 +149,7 @@ default ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus( + default @Valid ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) List status, @Parameter(hidden = true) final HttpServletRequest servletRequest ) { @@ -205,7 +205,7 @@ default ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags( + default @Valid ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) Set tags, @Parameter(hidden = true) final HttpServletRequest servletRequest ) { @@ -260,7 +260,7 @@ default ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById( + default @Valid ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(hidden = true) final HttpServletRequest servletRequest ) { @@ -391,7 +391,7 @@ default ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile( + default @Valid ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file, diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/StoreApi.java index 8860e2c74b8c..9b8eebd0c413 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/StoreApi.java @@ -102,7 +102,7 @@ default ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - default ResponseEntity> getInventory( + default @Valid ResponseEntity> getInventory( @Parameter(hidden = true) final HttpServletRequest servletRequest ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -139,7 +139,7 @@ default ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById( + default @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("order_id") Long orderId, @Parameter(hidden = true) final HttpServletRequest servletRequest ) { @@ -190,7 +190,7 @@ default ResponseEntity getOrderById( produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) - default ResponseEntity placeOrder( + default @Valid ResponseEntity placeOrder( @Parameter(name = "OrderDto", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody OrderDto orderDto, @Parameter(hidden = true) final HttpServletRequest servletRequest ) { diff --git a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/UserApi.java index 27661b2acb9d..7e575ad170ee 100644 --- a/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-include-http-request-context/src/main/java/org/openapitools/api/UserApi.java @@ -198,7 +198,7 @@ default ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName( + default @Valid ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, @Parameter(hidden = true) final HttpServletRequest servletRequest ) { @@ -249,7 +249,7 @@ default ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser( + default @Valid ResponseEntity loginUser( @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password, @Parameter(hidden = true) final HttpServletRequest servletRequest diff --git a/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/api/PetApi.java index 4e4d147509ba..e4a5b03ed5a4 100644 --- a/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/api/PetApi.java @@ -75,7 +75,7 @@ default Optional getRequest() { produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) - default ResponseEntity addPet( + default @Valid ResponseEntity addPet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { getRequest().ifPresent(request -> { @@ -161,7 +161,7 @@ default ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus( + default @Valid ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", deprecated = true, description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) @Deprecated List status ) { getRequest().ifPresent(request -> { @@ -216,7 +216,7 @@ default ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags( + default @Valid ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) List tags ) { getRequest().ifPresent(request -> { @@ -270,7 +270,7 @@ default ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById( + default @Valid ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { getRequest().ifPresent(request -> { @@ -330,7 +330,7 @@ default ResponseEntity getPetById( produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) - default ResponseEntity updatePet( + default @Valid ResponseEntity updatePet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { getRequest().ifPresent(request -> { @@ -419,7 +419,7 @@ default ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile( + default @Valid ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/api/StoreApi.java index ed9c67ec1a1f..f09c5f8c1070 100644 --- a/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/api/StoreApi.java @@ -100,7 +100,7 @@ default ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - default ResponseEntity> getInventory( + default @Valid ResponseEntity> getInventory( ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -137,7 +137,7 @@ default ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById( + default @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId ) { getRequest().ifPresent(request -> { @@ -187,7 +187,7 @@ default ResponseEntity getOrderById( produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) - default ResponseEntity placeOrder( + default @Valid ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/api/UserApi.java index 7085f8406116..3170d7e359ae 100644 --- a/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-lombok-data/src/main/java/org/openapitools/api/UserApi.java @@ -205,7 +205,7 @@ default ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName( + default @Valid ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { getRequest().ifPresent(request -> { @@ -255,7 +255,7 @@ default ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser( + default @Valid ResponseEntity loginUser( @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ) { diff --git a/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/api/PetApi.java index 4e4d147509ba..e4a5b03ed5a4 100644 --- a/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/api/PetApi.java @@ -75,7 +75,7 @@ default Optional getRequest() { produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) - default ResponseEntity addPet( + default @Valid ResponseEntity addPet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { getRequest().ifPresent(request -> { @@ -161,7 +161,7 @@ default ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus( + default @Valid ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", deprecated = true, description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) @Deprecated List status ) { getRequest().ifPresent(request -> { @@ -216,7 +216,7 @@ default ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags( + default @Valid ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) List tags ) { getRequest().ifPresent(request -> { @@ -270,7 +270,7 @@ default ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById( + default @Valid ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { getRequest().ifPresent(request -> { @@ -330,7 +330,7 @@ default ResponseEntity getPetById( produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) - default ResponseEntity updatePet( + default @Valid ResponseEntity updatePet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { getRequest().ifPresent(request -> { @@ -419,7 +419,7 @@ default ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile( + default @Valid ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/api/StoreApi.java index ed9c67ec1a1f..f09c5f8c1070 100644 --- a/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/api/StoreApi.java @@ -100,7 +100,7 @@ default ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - default ResponseEntity> getInventory( + default @Valid ResponseEntity> getInventory( ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -137,7 +137,7 @@ default ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById( + default @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId ) { getRequest().ifPresent(request -> { @@ -187,7 +187,7 @@ default ResponseEntity getOrderById( produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) - default ResponseEntity placeOrder( + default @Valid ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/api/UserApi.java index 7085f8406116..3170d7e359ae 100644 --- a/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-lombok-tostring/src/main/java/org/openapitools/api/UserApi.java @@ -205,7 +205,7 @@ default ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName( + default @Valid ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { getRequest().ifPresent(request -> { @@ -255,7 +255,7 @@ default ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser( + default @Valid ResponseEntity loginUser( @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ) { diff --git a/samples/server/petstore/springboot-paged-model/src/main/java/org/openapitools/api/OrderApi.java b/samples/server/petstore/springboot-paged-model/src/main/java/org/openapitools/api/OrderApi.java index ebcff04ac4aa..75fec4a4740d 100644 --- a/samples/server/petstore/springboot-paged-model/src/main/java/org/openapitools/api/OrderApi.java +++ b/samples/server/petstore/springboot-paged-model/src/main/java/org/openapitools/api/OrderApi.java @@ -38,7 +38,7 @@ public interface OrderApi { value = OrderApi.PATH_LIST_ORDERS, produces = { "application/json" } ) - ResponseEntity> listOrders( + @Valid ResponseEntity> listOrders( @Valid @RequestParam(value = "page", required = false, defaultValue = "0") Integer page, @Valid @RequestParam(value = "size", required = false, defaultValue = "20") Integer size ); diff --git a/samples/server/petstore/springboot-paged-model/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-paged-model/src/main/java/org/openapitools/api/PetApi.java index 66235866284d..c7ddad796b04 100644 --- a/samples/server/petstore/springboot-paged-model/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-paged-model/src/main/java/org/openapitools/api/PetApi.java @@ -37,7 +37,7 @@ public interface PetApi { value = PetApi.PATH_FIND_PETS, produces = { "application/json" } ) - ResponseEntity> findPets( + @Valid ResponseEntity> findPets( ); @@ -53,7 +53,7 @@ ResponseEntity> findPets( value = PetApi.PATH_LIST_PETS_PAGED, produces = { "application/json" } ) - ResponseEntity> listPetsPaged( + @Valid ResponseEntity> listPetsPaged( ); @@ -70,7 +70,7 @@ ResponseEntity> listPetsPaged( value = PetApi.PATH_SEARCH_PETS, produces = { "application/json" } ) - ResponseEntity searchPets( + @Valid ResponseEntity searchPets( @Valid @RequestParam(value = "q", required = false) @Nullable String q ); diff --git a/samples/server/petstore/springboot-paged-model/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-paged-model/src/main/java/org/openapitools/api/UserApi.java index efacaa9cc380..478324ccb034 100644 --- a/samples/server/petstore/springboot-paged-model/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-paged-model/src/main/java/org/openapitools/api/UserApi.java @@ -39,7 +39,7 @@ public interface UserApi { value = UserApi.PATH_LIST_USERS, produces = { "application/json" } ) - ResponseEntity> listUsers( + @Valid ResponseEntity> listUsers( @Valid @RequestParam(value = "page", required = false, defaultValue = "0") Integer page, @Valid @RequestParam(value = "size", required = false, defaultValue = "20") Integer size ); @@ -56,7 +56,7 @@ ResponseEntity> listUsers( value = UserApi.PATH_LIST_USERS_SIMPLE, produces = { "application/json" } ) - ResponseEntity listUsersSimple( + @Valid ResponseEntity listUsersSimple( ); diff --git a/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/api/PetApi.java index fa987411ba04..02104fcc1158 100644 --- a/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/api/PetApi.java @@ -81,7 +81,7 @@ default PetApiDelegate getDelegate() { produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) - default ResponseEntity addPet( + default @Valid ResponseEntity addPet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { return getDelegate().addPet(pet); @@ -157,7 +157,7 @@ default ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus( + default @Valid ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", deprecated = true, description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) @Deprecated List status ) { return getDelegate().findPetsByStatus(status); @@ -197,7 +197,7 @@ default ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags( + default @Valid ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) List tags ) { return getDelegate().findPetsByTags(tags); @@ -236,7 +236,7 @@ default ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById( + default @Valid ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { return getDelegate().getPetById(petId); @@ -281,7 +281,7 @@ default ResponseEntity getPetById( produces = { "application/xml", "application/json" }, consumes = { "application/json", "application/xml" } ) - default ResponseEntity updatePet( + default @Valid ResponseEntity updatePet( @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { return getDelegate().updatePet(pet); @@ -354,7 +354,7 @@ default ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile( + default @Valid ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/api/PetApiDelegate.java index 766af6ae8bab..00fceab80816 100644 --- a/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -36,7 +36,7 @@ default Optional getRequest() { * or Invalid input (status code 405) * @see PetApi#addPet */ - default ResponseEntity addPet(Pet pet) { + default @Valid ResponseEntity addPet(Pet pet) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -79,7 +79,7 @@ default ResponseEntity deletePet(Long petId, * or Invalid status value (status code 400) * @see PetApi#findPetsByStatus */ - default ResponseEntity> findPetsByStatus(List status) { + default @Valid ResponseEntity> findPetsByStatus(List status) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -109,7 +109,7 @@ default ResponseEntity> findPetsByStatus(List status) { * @see PetApi#findPetsByTags */ @Deprecated - default ResponseEntity> findPetsByTags(List tags) { + default @Valid ResponseEntity> findPetsByTags(List tags) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -138,7 +138,7 @@ default ResponseEntity> findPetsByTags(List tags) { * or Pet not found (status code 404) * @see PetApi#getPetById */ - default ResponseEntity getPetById(Long petId) { + default @Valid ResponseEntity getPetById(Long petId) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -170,7 +170,7 @@ default ResponseEntity getPetById(Long petId) { * @see Update an existing pet Documentation * @see PetApi#updatePet */ - default ResponseEntity updatePet(Pet pet) { + default @Valid ResponseEntity updatePet(Pet pet) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -216,7 +216,7 @@ default ResponseEntity updatePetWithForm(Long petId, * @return successful operation (status code 200) * @see PetApi#uploadFile */ - default ResponseEntity uploadFile(Long petId, + default @Valid ResponseEntity uploadFile(Long petId, String additionalMetadata, MultipartFile file) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/api/StoreApi.java index 3d99df57b0ba..badf63baae3e 100644 --- a/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/api/StoreApi.java @@ -95,7 +95,7 @@ default ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - default ResponseEntity> getInventory( + default @Valid ResponseEntity> getInventory( ) { return getDelegate().getInventory(); @@ -131,7 +131,7 @@ default ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById( + default @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "orderId", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("orderId") Long orderId ) { return getDelegate().getOrderById(orderId); @@ -166,7 +166,7 @@ default ResponseEntity getOrderById( produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) - default ResponseEntity placeOrder( + default @Valid ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { return getDelegate().placeOrder(order); diff --git a/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/api/StoreApiDelegate.java b/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/api/StoreApiDelegate.java index 8cc942e2254f..cbb917dddbf8 100644 --- a/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/api/StoreApiDelegate.java +++ b/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/api/StoreApiDelegate.java @@ -47,7 +47,7 @@ default ResponseEntity deleteOrder(String orderId) { * @return successful operation (status code 200) * @see StoreApi#getInventory */ - default ResponseEntity> getInventory() { + default @Valid ResponseEntity> getInventory() { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -62,7 +62,7 @@ default ResponseEntity> getInventory() { * or Order not found (status code 404) * @see StoreApi#getOrderById */ - default ResponseEntity getOrderById(Long orderId) { + default @Valid ResponseEntity getOrderById(Long orderId) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -90,7 +90,7 @@ default ResponseEntity getOrderById(Long orderId) { * or Invalid Order (status code 400) * @see StoreApi#placeOrder */ - default ResponseEntity placeOrder(Order order) { + default @Valid ResponseEntity placeOrder(Order order) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/api/UserApi.java index a9f18949a394..e2fa87eff731 100644 --- a/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/api/UserApi.java @@ -197,7 +197,7 @@ default ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName( + default @Valid ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { return getDelegate().getUserByName(username); @@ -232,7 +232,7 @@ default ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser( + default @Valid ResponseEntity loginUser( @NotNull @Pattern(regexp = "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$") @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ) { diff --git a/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/api/UserApiDelegate.java index e9c84c0901f2..71a53fc34ef9 100644 --- a/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-petstore-with-api-response-examples/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -89,7 +89,7 @@ default ResponseEntity deleteUser(String username) { * or User not found (status code 404) * @see UserApi#getUserByName */ - default ResponseEntity getUserByName(String username) { + default @Valid ResponseEntity getUserByName(String username) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -118,7 +118,7 @@ default ResponseEntity getUserByName(String username) { * or Invalid username/password supplied (status code 400) * @see UserApi#loginUser */ - default ResponseEntity loginUser(String username, + default @Valid ResponseEntity loginUser(String username, String password) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/AnotherFakeApi.java index c38e60c91186..4124dae32798 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -67,7 +67,7 @@ default AnotherFakeApiDelegate getDelegate() { consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) - default Mono call123testSpecialTags( + default @Valid Mono call123testSpecialTags( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Mono client ) { return getDelegate().call123testSpecialTags(client); diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java index d5776693cfff..b35d8ceffed4 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java @@ -35,7 +35,7 @@ default Optional getRequest() { * @return successful operation (status code 200) * @see AnotherFakeApi#call123testSpecialTags */ - default Mono call123testSpecialTags(Mono client) { + default @Valid Mono call123testSpecialTags(Mono client) { Mono result = Mono.empty(); 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 6681a0d907ee..7430d52e0959 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 @@ -109,7 +109,7 @@ default Mono createXmlItem( consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) - default Mono fakeOuterBooleanSerialize( + default @Valid Mono fakeOuterBooleanSerialize( @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Mono body ) { return getDelegate().fakeOuterBooleanSerialize(body); @@ -141,7 +141,7 @@ default Mono fakeOuterBooleanSerialize( consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) - default Mono fakeOuterCompositeSerialize( + default @Valid Mono fakeOuterCompositeSerialize( @Parameter(name = "OuterComposite", description = "Input composite as post body") @Valid @RequestBody(required = false) Mono outerComposite ) { return getDelegate().fakeOuterCompositeSerialize(outerComposite); @@ -173,7 +173,7 @@ default Mono fakeOuterCompositeSerialize( consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) - default Mono fakeOuterNumberSerialize( + default @Valid Mono fakeOuterNumberSerialize( @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) Mono body ) { return getDelegate().fakeOuterNumberSerialize(body); @@ -205,7 +205,7 @@ default Mono fakeOuterNumberSerialize( consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) - default Mono fakeOuterStringSerialize( + default @Valid Mono fakeOuterStringSerialize( @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) Mono body ) { return getDelegate().fakeOuterStringSerialize(body); @@ -234,7 +234,7 @@ default Mono fakeOuterStringSerialize( produces = { "application/json" } ) @ResponseStatus(HttpStatus.OK) - default Mono responseObjectDifferentNames( + default @Valid Mono responseObjectDifferentNames( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { return getDelegate().responseObjectDifferentNames(petId); @@ -325,7 +325,7 @@ default Mono testBodyWithQueryParams( consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) - default Mono testClientModel( + default @Valid Mono testClientModel( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Mono client ) { return getDelegate().testClientModel(client); @@ -627,7 +627,7 @@ default Mono testQueryParameterCollectionFormat( produces = { "application/json" } ) @ResponseStatus(HttpStatus.OK) - default Mono testWithResultExample( + default @Valid Mono testWithResultExample( ) { return getDelegate().testWithResultExample(); @@ -665,7 +665,7 @@ default Mono testWithResultExample( consumes = { "multipart/form-data" } ) @ResponseStatus(HttpStatus.OK) - default Mono uploadFileWithRequiredFile( + default @Valid Mono uploadFileWithRequiredFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) Part requiredFile, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata 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 177baf4b0def..ddc904eee10c 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 @@ -64,7 +64,7 @@ default Mono createXmlItem(Mono xmlItem) { * @return Output boolean (status code 200) * @see FakeApi#fakeOuterBooleanSerialize */ - default Mono fakeOuterBooleanSerialize(Mono body) { + default @Valid Mono fakeOuterBooleanSerialize(Mono body) { Mono result = Mono.empty(); @@ -80,7 +80,7 @@ default Mono fakeOuterBooleanSerialize(Mono body) { * @return Output composite (status code 200) * @see FakeApi#fakeOuterCompositeSerialize */ - default Mono fakeOuterCompositeSerialize(Mono outerComposite) { + default @Valid Mono fakeOuterCompositeSerialize(Mono outerComposite) { Mono result = Mono.empty(); @@ -96,7 +96,7 @@ default Mono fakeOuterCompositeSerialize(Mono ou * @return Output number (status code 200) * @see FakeApi#fakeOuterNumberSerialize */ - default Mono fakeOuterNumberSerialize(Mono body) { + default @Valid Mono fakeOuterNumberSerialize(Mono body) { Mono result = Mono.empty(); @@ -112,7 +112,7 @@ default Mono fakeOuterNumberSerialize(Mono body) { * @return Output string (status code 200) * @see FakeApi#fakeOuterStringSerialize */ - default Mono fakeOuterStringSerialize(Mono body) { + default @Valid Mono fakeOuterStringSerialize(Mono body) { Mono result = Mono.empty(); @@ -127,7 +127,7 @@ default Mono fakeOuterStringSerialize(Mono body) { * @return successful operation (status code 200) * @see FakeApi#responseObjectDifferentNames */ - default Mono responseObjectDifferentNames(Long petId) { + default @Valid Mono responseObjectDifferentNames(Long petId) { Mono result = Mono.empty(); @@ -176,7 +176,7 @@ default Mono testBodyWithQueryParams(String query, * @return successful operation (status code 200) * @see FakeApi#testClientModel */ - default Mono testClientModel(Mono client) { + default @Valid Mono testClientModel(Mono client) { Mono result = Mono.empty(); @@ -363,7 +363,7 @@ default Mono testQueryParameterCollectionFormat(List pipe, * @return Success (status code 200) * @see FakeApi#testWithResultExample */ - default Mono testWithResultExample() { + default @Valid Mono testWithResultExample() { Mono result = Mono.empty(); @@ -381,7 +381,7 @@ default Mono testWithResultExample() { * @return successful operation (status code 200) * @see FakeApi#uploadFileWithRequiredFile */ - default Mono uploadFileWithRequiredFile(Long petId, + default @Valid Mono uploadFileWithRequiredFile(Long petId, Part requiredFile, String additionalMetadata) { Mono result = Mono.empty(); diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 585c2a0e017b..14d2899f4db7 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -70,7 +70,7 @@ default FakeClassnameTestApiDelegate getDelegate() { consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) - default Mono testClassname( + default @Valid Mono testClassname( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Mono client ) { return getDelegate().testClassname(client); diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java index f2957f31faa9..562948450f5a 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java @@ -35,7 +35,7 @@ default Optional getRequest() { * @return successful operation (status code 200) * @see FakeClassnameTestApi#testClassname */ - default Mono testClassname(Mono client) { + default @Valid Mono testClassname(Mono client) { 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 44c8d7cdb0f9..79184358ecdc 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 @@ -146,7 +146,7 @@ default Mono deletePet( produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) - default Flux findPetsByStatus( + default @Valid Flux<@Valid Pet> findPetsByStatus( @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) List status ) { return getDelegate().findPetsByStatus(status); @@ -187,7 +187,7 @@ default Flux findPetsByStatus( produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) - default Flux findPetsByTags( + default @Valid Flux<@Valid Pet> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) Set tags ) { return getDelegate().findPetsByTags(tags); @@ -227,7 +227,7 @@ default Flux findPetsByTags( produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) - default Mono getPetById( + default @Valid Mono getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { return getDelegate().getPetById(petId); @@ -341,7 +341,7 @@ default Mono updatePetWithForm( consumes = { "multipart/form-data" } ) @ResponseStatus(HttpStatus.OK) - default Mono uploadFile( + default @Valid Mono uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) Part file 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 fcb15addda56..517130635a10 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 @@ -75,7 +75,7 @@ default Mono deletePet(Long petId, * or Invalid status value (status code 400) * @see PetApi#findPetsByStatus */ - default Flux findPetsByStatus(List status) { + default @Valid Flux<@Valid Pet> findPetsByStatus(List status) { Mono result = Mono.empty(); @@ -94,7 +94,7 @@ default Flux findPetsByStatus(List status) { * @see PetApi#findPetsByTags */ @Deprecated - default Flux findPetsByTags(Set tags) { + default @Valid Flux<@Valid Pet> findPetsByTags(Set tags) { Mono result = Mono.empty(); @@ -112,7 +112,7 @@ default Flux findPetsByTags(Set tags) { * or Pet not found (status code 404) * @see PetApi#getPetById */ - default Mono getPetById(Long petId) { + default @Valid Mono getPetById(Long petId) { Mono result = Mono.empty(); @@ -169,7 +169,7 @@ default Mono updatePetWithForm(Long petId, * @return successful operation (status code 200) * @see PetApi#uploadFile */ - default Mono uploadFile(Long petId, + default @Valid Mono uploadFile(Long petId, String additionalMetadata, Part file) { Mono result = Mono.empty(); diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/StoreApi.java index bd88495ca885..ccf0edcfab27 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/StoreApi.java @@ -100,7 +100,7 @@ default Mono deleteOrder( produces = { "application/json" } ) @ResponseStatus(HttpStatus.OK) - default Mono> getInventory( + default @Valid Mono> getInventory( ) { return getDelegate().getInventory(); @@ -137,7 +137,7 @@ default Mono> getInventory( produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) - default Mono getOrderById( + default @Valid Mono getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("order_id") Long orderId ) { return getDelegate().getOrderById(orderId); @@ -173,7 +173,7 @@ default Mono getOrderById( consumes = { "application/json" } ) @ResponseStatus(HttpStatus.OK) - default Mono placeOrder( + default @Valid Mono placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Mono order ) { return getDelegate().placeOrder(order); diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/StoreApiDelegate.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/StoreApiDelegate.java index 2ce85139e084..4fd41f5a1a35 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/StoreApiDelegate.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/StoreApiDelegate.java @@ -52,7 +52,7 @@ default Mono deleteOrder(String orderId) { * @return successful operation (status code 200) * @see StoreApi#getInventory */ - default Mono> getInventory() { + default @Valid Mono> getInventory() { Mono result = Mono.empty(); @@ -70,7 +70,7 @@ default Mono> getInventory() { * or Order not found (status code 404) * @see StoreApi#getOrderById */ - default Mono getOrderById(Long orderId) { + default @Valid Mono getOrderById(Long orderId) { Mono result = Mono.empty(); @@ -87,7 +87,7 @@ default Mono getOrderById(Long orderId) { * or Invalid Order (status code 400) * @see StoreApi#placeOrder */ - default Mono placeOrder(Mono order) { + default @Valid Mono placeOrder(Mono order) { Mono result = Mono.empty(); diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/UserApi.java index a7ef85924fff..2286ef84c366 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/UserApi.java @@ -193,7 +193,7 @@ default Mono deleteUser( produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) - default Mono getUserByName( + default @Valid Mono getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { return getDelegate().getUserByName(username); @@ -229,7 +229,7 @@ default Mono getUserByName( produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) - default Mono loginUser( + default @Valid Mono loginUser( @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ) { diff --git a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/UserApiDelegate.java index 0b28240560ac..84b9bc7da769 100644 --- a/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-reactive-noResponseEntity/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -103,7 +103,7 @@ default Mono deleteUser(String username) { * or User not found (status code 404) * @see UserApi#getUserByName */ - default Mono getUserByName(String username) { + default @Valid Mono getUserByName(String username) { Mono result = Mono.empty(); @@ -121,7 +121,7 @@ default Mono getUserByName(String username) { * or Invalid username/password supplied (status code 400) * @see UserApi#loginUser */ - default Mono loginUser(String username, + default @Valid Mono loginUser(String username, String password) { Mono result = Mono.empty(); 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 af2c563197ab..83ed8df97d94 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 @@ -67,7 +67,7 @@ default AnotherFakeApiDelegate getDelegate() { produces = { "application/json" }, consumes = { "application/json" } ) - default Mono> call123testSpecialTags( + default @Valid Mono> call123testSpecialTags( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Mono client, @Parameter(hidden = true) final ServerWebExchange exchange ) { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java index cdd19309627a..f4363eb7d04d 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java @@ -37,7 +37,7 @@ default Optional getRequest() { * @return successful operation (status code 200) * @see AnotherFakeApi#call123testSpecialTags */ - default Mono> call123testSpecialTags(Mono client, + default @Valid Mono> call123testSpecialTags(Mono client, ServerWebExchange exchange) { Mono result = Mono.empty(); 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 58ad16021b59..afd1548ab70a 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 @@ -109,7 +109,7 @@ default Mono> createXmlItem( produces = { "*/*" }, consumes = { "application/json" } ) - default Mono> fakeOuterBooleanSerialize( + default @Valid Mono> fakeOuterBooleanSerialize( @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Mono body, @Parameter(hidden = true) final ServerWebExchange exchange ) { @@ -141,7 +141,7 @@ default Mono> fakeOuterBooleanSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default Mono> fakeOuterCompositeSerialize( + default @Valid Mono> fakeOuterCompositeSerialize( @Parameter(name = "OuterComposite", description = "Input composite as post body") @Valid @RequestBody(required = false) Mono outerComposite, @Parameter(hidden = true) final ServerWebExchange exchange ) { @@ -173,7 +173,7 @@ default Mono> fakeOuterCompositeSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default Mono> fakeOuterNumberSerialize( + default @Valid Mono> fakeOuterNumberSerialize( @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) Mono body, @Parameter(hidden = true) final ServerWebExchange exchange ) { @@ -205,7 +205,7 @@ default Mono> fakeOuterNumberSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default Mono> fakeOuterStringSerialize( + default @Valid Mono> fakeOuterStringSerialize( @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) Mono body, @Parameter(hidden = true) final ServerWebExchange exchange ) { @@ -234,7 +234,7 @@ default Mono> fakeOuterStringSerialize( value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) - default Mono> responseObjectDifferentNames( + default @Valid Mono> responseObjectDifferentNames( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(hidden = true) final ServerWebExchange exchange ) { @@ -325,7 +325,7 @@ default Mono> testBodyWithQueryParams( produces = { "application/json" }, consumes = { "application/json" } ) - default Mono> testClientModel( + default @Valid Mono> testClientModel( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Mono client, @Parameter(hidden = true) final ServerWebExchange exchange ) { @@ -627,7 +627,7 @@ default Mono> testQueryParameterCollectionFormat( value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) - default Mono> testWithResultExample( + default @Valid Mono> testWithResultExample( @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().testWithResultExample(exchange); @@ -664,7 +664,7 @@ default Mono> testWithResultExample( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default Mono> uploadFileWithRequiredFile( + default @Valid Mono> uploadFileWithRequiredFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) Part requiredFile, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, 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 5974e367e346..f518982f8e87 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 @@ -69,7 +69,7 @@ default Mono> createXmlItem(Mono xmlItem, * @return Output boolean (status code 200) * @see FakeApi#fakeOuterBooleanSerialize */ - default Mono> fakeOuterBooleanSerialize(Mono body, + default @Valid Mono> fakeOuterBooleanSerialize(Mono body, ServerWebExchange exchange) { Mono result = Mono.empty(); @@ -88,7 +88,7 @@ default Mono> fakeOuterBooleanSerialize(Mono bo * @return Output composite (status code 200) * @see FakeApi#fakeOuterCompositeSerialize */ - default Mono> fakeOuterCompositeSerialize(Mono outerComposite, + default @Valid Mono> fakeOuterCompositeSerialize(Mono outerComposite, ServerWebExchange exchange) { Mono result = Mono.empty(); @@ -114,7 +114,7 @@ default Mono> fakeOuterCompositeSerialize(Mono> fakeOuterNumberSerialize(Mono body, + default @Valid Mono> fakeOuterNumberSerialize(Mono body, ServerWebExchange exchange) { Mono result = Mono.empty(); @@ -133,7 +133,7 @@ default Mono> fakeOuterNumberSerialize(Mono> fakeOuterStringSerialize(Mono body, + default @Valid Mono> fakeOuterStringSerialize(Mono body, ServerWebExchange exchange) { Mono result = Mono.empty(); @@ -151,7 +151,7 @@ default Mono> fakeOuterStringSerialize(Mono body, * @return successful operation (status code 200) * @see FakeApi#responseObjectDifferentNames */ - default Mono> responseObjectDifferentNames(Long petId, + default @Valid Mono> responseObjectDifferentNames(Long petId, ServerWebExchange exchange) { Mono result = Mono.empty(); @@ -216,7 +216,7 @@ default Mono> testBodyWithQueryParams(String query, * @return successful operation (status code 200) * @see FakeApi#testClientModel */ - default Mono> testClientModel(Mono client, + default @Valid Mono> testClientModel(Mono client, ServerWebExchange exchange) { Mono result = Mono.empty(); @@ -434,7 +434,7 @@ default Mono> testQueryParameterCollectionFormat(List> testWithResultExample(ServerWebExchange exchange) { + default @Valid Mono> testWithResultExample(ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); @@ -461,7 +461,7 @@ default Mono> testWithResultExample(ServerWebExchange ex * @return successful operation (status code 200) * @see FakeApi#uploadFileWithRequiredFile */ - default Mono> uploadFileWithRequiredFile(Long petId, + default @Valid Mono> uploadFileWithRequiredFile(Long petId, Part requiredFile, String additionalMetadata, ServerWebExchange 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 ad5612337871..f07382546b45 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 @@ -70,7 +70,7 @@ default FakeClassnameTestApiDelegate getDelegate() { produces = { "application/json" }, consumes = { "application/json" } ) - default Mono> testClassname( + default @Valid Mono> testClassname( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Mono client, @Parameter(hidden = true) final ServerWebExchange exchange ) { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java index e79a0e8bfd1e..a8b4ddf94dc0 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java @@ -37,7 +37,7 @@ default Optional getRequest() { * @return successful operation (status code 200) * @see FakeClassnameTestApi#testClassname */ - default Mono> testClassname(Mono client, + default @Valid Mono> testClassname(Mono client, 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 7b08e2237e80..d2125e5f2366 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 @@ -146,7 +146,7 @@ default Mono> deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) - default Mono>> findPetsByStatus( + default @Valid Mono>> findPetsByStatus( @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) List status, @Parameter(hidden = true) final ServerWebExchange exchange ) { @@ -187,7 +187,7 @@ default Mono>> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) - default Mono>> findPetsByTags( + default @Valid Mono>> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) Set tags, @Parameter(hidden = true) final ServerWebExchange exchange ) { @@ -227,7 +227,7 @@ default Mono>> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) - default Mono> getPetById( + default @Valid Mono> getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(hidden = true) final ServerWebExchange exchange ) { @@ -341,7 +341,7 @@ default Mono> updatePetWithForm( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default Mono> uploadFile( + default @Valid Mono> uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestPart(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) Part file, 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 db740c264568..0f7472bf62d4 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 @@ -83,7 +83,7 @@ default Mono> deletePet(Long petId, * or Invalid status value (status code 400) * @see PetApi#findPetsByStatus */ - default Mono>> findPetsByStatus(List status, + default @Valid Mono>> findPetsByStatus(List status, ServerWebExchange exchange) { Mono result = Mono.empty(); @@ -118,7 +118,7 @@ default Mono>> findPetsByStatus(List status, * @see PetApi#findPetsByTags */ @Deprecated - default Mono>> findPetsByTags(Set tags, + default @Valid Mono>> findPetsByTags(Set tags, ServerWebExchange exchange) { Mono result = Mono.empty(); @@ -152,7 +152,7 @@ default Mono>> findPetsByTags(Set tags, * or Pet not found (status code 404) * @see PetApi#getPetById */ - default Mono> getPetById(Long petId, + default @Valid Mono> getPetById(Long petId, ServerWebExchange exchange) { Mono result = Mono.empty(); @@ -231,7 +231,7 @@ default Mono> updatePetWithForm(Long petId, * @return successful operation (status code 200) * @see PetApi#uploadFile */ - default Mono> uploadFile(Long petId, + default @Valid Mono> uploadFile(Long petId, String additionalMetadata, Part file, ServerWebExchange 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 b564e2670d5c..0518aacb5c10 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 @@ -100,7 +100,7 @@ default Mono> deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - default Mono>> getInventory( + default @Valid Mono>> getInventory( @Parameter(hidden = true) final ServerWebExchange exchange ) { return getDelegate().getInventory(exchange); @@ -136,7 +136,7 @@ default Mono>> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) - default Mono> getOrderById( + default @Valid Mono> getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("order_id") Long orderId, @Parameter(hidden = true) final ServerWebExchange exchange ) { @@ -172,7 +172,7 @@ default Mono> getOrderById( produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) - default Mono> placeOrder( + default @Valid Mono> placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Mono order, @Parameter(hidden = true) final ServerWebExchange exchange ) { diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java index a80ad6fc4aa4..9ba6a688f675 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java @@ -57,7 +57,7 @@ default Mono> deleteOrder(String orderId, * @return successful operation (status code 200) * @see StoreApi#getInventory */ - default Mono>> getInventory(ServerWebExchange exchange) { + default @Valid Mono>> getInventory(ServerWebExchange exchange) { Mono result = Mono.empty(); @@ -77,7 +77,7 @@ default Mono>> getInventory(ServerWebExchang * or Order not found (status code 404) * @see StoreApi#getOrderById */ - default Mono> getOrderById(Long orderId, + default @Valid Mono> getOrderById(Long orderId, ServerWebExchange exchange) { Mono result = Mono.empty(); @@ -110,7 +110,7 @@ default Mono> getOrderById(Long orderId, * or Invalid Order (status code 400) * @see StoreApi#placeOrder */ - default Mono> placeOrder(Mono order, + default @Valid Mono> placeOrder(Mono order, ServerWebExchange exchange) { Mono result = Mono.empty(); 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 da02eac5662f..8b52b6d69ff5 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 @@ -193,7 +193,7 @@ default Mono> deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) - default Mono> getUserByName( + default @Valid Mono> getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, @Parameter(hidden = true) final ServerWebExchange exchange ) { @@ -229,7 +229,7 @@ default Mono> getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) - default Mono> loginUser( + default @Valid Mono> loginUser( @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password, @Parameter(hidden = true) final ServerWebExchange exchange diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java index 3c16fd56b564..e8cb4b11028a 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -117,7 +117,7 @@ default Mono> deleteUser(String username, * or User not found (status code 404) * @see UserApi#getUserByName */ - default Mono> getUserByName(String username, + default @Valid Mono> getUserByName(String username, ServerWebExchange exchange) { Mono result = Mono.empty(); @@ -151,7 +151,7 @@ default Mono> getUserByName(String username, * or Invalid username/password supplied (status code 400) * @see UserApi#loginUser */ - default Mono> loginUser(String username, + default @Valid Mono> loginUser(String username, String password, ServerWebExchange exchange) { Mono result = Mono.empty(); diff --git a/samples/server/petstore/springboot-sort-validation/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-sort-validation/src/main/java/org/openapitools/api/PetApi.java index 32fb8115d75a..9ce45d5143fe 100644 --- a/samples/server/petstore/springboot-sort-validation/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-sort-validation/src/main/java/org/openapitools/api/PetApi.java @@ -47,7 +47,7 @@ public interface PetApi { value = PetApi.PATH_FIND_PETS_AUTO_DETECTED_WITH_SORT, produces = { "application/json" } ) - ResponseEntity> findPetsAutoDetectedWithSort( + @Valid ResponseEntity> findPetsAutoDetectedWithSort( @Valid @RequestParam(value = "status", required = false) @Nullable String status, @Valid @RequestParam(value = "page", required = false, defaultValue = "0") Integer page, @Valid @RequestParam(value = "size", required = false, defaultValue = "20") Integer size, @@ -67,7 +67,7 @@ ResponseEntity> findPetsAutoDetectedWithSort( value = PetApi.PATH_FIND_PETS_NON_PAGINATED_WITH_SORT_ENUM, produces = { "application/json" } ) - ResponseEntity> findPetsNonPaginatedWithSortEnum( + @Valid ResponseEntity> findPetsNonPaginatedWithSortEnum( @Valid @RequestParam(value = "sort", required = false) @Nullable String sort ); @@ -83,7 +83,7 @@ ResponseEntity> findPetsNonPaginatedWithSortEnum( value = PetApi.PATH_FIND_PETS_WITH_ALL_DEFAULTS, produces = { "application/json" } ) - ResponseEntity> findPetsWithAllDefaults( + @Valid ResponseEntity> findPetsWithAllDefaults( @PageableDefault(page = 0, size = 10) @SortDefault.SortDefaults({@SortDefault(sort = {"name"}, direction = Sort.Direction.DESC), @SortDefault(sort = {"id"}, direction = Sort.Direction.ASC)}) final Pageable pageable ); @@ -99,7 +99,7 @@ ResponseEntity> findPetsWithAllDefaults( value = PetApi.PATH_FIND_PETS_WITH_ARRAY_SORT_ENUM, produces = { "application/json" } ) - ResponseEntity> findPetsWithArraySortEnum( + @Valid ResponseEntity> findPetsWithArraySortEnum( @ValidSort(allowedValues = {"id,asc", "id,desc", "name,asc", "name,desc"}) @PageableDefault(page = 0, size = 20) final Pageable pageable ); @@ -115,7 +115,7 @@ ResponseEntity> findPetsWithArraySortEnum( value = PetApi.PATH_FIND_PETS_WITH_ARRAY_SORT_REF_ENUM, produces = { "application/json" } ) - ResponseEntity> findPetsWithArraySortRefEnum( + @Valid ResponseEntity> findPetsWithArraySortRefEnum( @ValidSort(allowedValues = {"id,asc", "id,desc", "createdAt,asc", "createdAt,desc"}) @PageableDefault(page = 0, size = 20) final Pageable pageable ); @@ -131,7 +131,7 @@ ResponseEntity> findPetsWithArraySortRefEnum( value = PetApi.PATH_FIND_PETS_WITH_DEFAULT_FROM_ALL_OF_REF, produces = { "application/json" } ) - ResponseEntity> findPetsWithDefaultFromAllOfRef( + @Valid ResponseEntity> findPetsWithDefaultFromAllOfRef( final Pageable pageable ); @@ -147,7 +147,7 @@ ResponseEntity> findPetsWithDefaultFromAllOfRef( value = PetApi.PATH_FIND_PETS_WITH_EXTERNAL_PARAM_REF_ARRAY_SORT, produces = { "application/json" } ) - ResponseEntity> findPetsWithExternalParamRefArraySort( + @Valid ResponseEntity> findPetsWithExternalParamRefArraySort( @ValidSort(allowedValues = {"name,asc", "name,desc", "id,asc", "id,desc"}) @PageableDefault(page = 0, size = 20) final Pageable pageable ); @@ -163,7 +163,7 @@ ResponseEntity> findPetsWithExternalParamRefArraySort( value = PetApi.PATH_FIND_PETS_WITH_MIN_SIZE_CONSTRAINT_FROM_ALL_OF_REF, produces = { "application/json" } ) - ResponseEntity> findPetsWithMinSizeConstraintFromAllOfRef( + @Valid ResponseEntity> findPetsWithMinSizeConstraintFromAllOfRef( @ValidPageable(minSize = 5) final Pageable pageable ); @@ -179,7 +179,7 @@ ResponseEntity> findPetsWithMinSizeConstraintFromAllOfRef( value = PetApi.PATH_FIND_PETS_WITH_MIXED_SORT_DEFAULTS, produces = { "application/json" } ) - ResponseEntity> findPetsWithMixedSortDefaults( + @Valid ResponseEntity> findPetsWithMixedSortDefaults( @SortDefault.SortDefaults({@SortDefault(sort = {"name"}, direction = Sort.Direction.DESC), @SortDefault(sort = {"id"}, direction = Sort.Direction.ASC)}) final Pageable pageable ); @@ -195,7 +195,7 @@ ResponseEntity> findPetsWithMixedSortDefaults( value = PetApi.PATH_FIND_PETS_WITH_NON_EXPLODED_EXTERNAL_PARAM_REF_ARRAY_SORT, produces = { "application/json" } ) - ResponseEntity> findPetsWithNonExplodedExternalParamRefArraySort( + @Valid ResponseEntity> findPetsWithNonExplodedExternalParamRefArraySort( @ValidSort(allowedValues = {"name,asc", "name,desc", "id,asc", "id,desc"}) @PageableDefault(page = 0, size = 20) final Pageable pageable ); @@ -211,7 +211,7 @@ ResponseEntity> findPetsWithNonExplodedExternalParamRefArraySort( value = PetApi.PATH_FIND_PETS_WITH_PAGE_AND_SIZE_CONSTRAINT, produces = { "application/json" } ) - ResponseEntity> findPetsWithPageAndSizeConstraint( + @Valid ResponseEntity> findPetsWithPageAndSizeConstraint( @ValidPageable(maxSize = 50, maxPage = 999) final Pageable pageable ); @@ -227,7 +227,7 @@ ResponseEntity> findPetsWithPageAndSizeConstraint( value = PetApi.PATH_FIND_PETS_WITH_PAGE_SIZE_DEFAULTS_ONLY, produces = { "application/json" } ) - ResponseEntity> findPetsWithPageSizeDefaultsOnly( + @Valid ResponseEntity> findPetsWithPageSizeDefaultsOnly( @PageableDefault(page = 0, size = 25) final Pageable pageable ); @@ -243,7 +243,7 @@ ResponseEntity> findPetsWithPageSizeDefaultsOnly( value = PetApi.PATH_FIND_PETS_WITH_REF_SORT, produces = { "application/json" } ) - ResponseEntity> findPetsWithRefSort( + @Valid ResponseEntity> findPetsWithRefSort( @ValidSort(allowedValues = {"id,asc", "id,desc", "createdAt,asc", "createdAt,desc"}) @PageableDefault(page = 0, size = 20) final Pageable pageable ); @@ -259,7 +259,7 @@ ResponseEntity> findPetsWithRefSort( value = PetApi.PATH_FIND_PETS_WITH_SIZE_CONSTRAINT, produces = { "application/json" } ) - ResponseEntity> findPetsWithSizeConstraint( + @Valid ResponseEntity> findPetsWithSizeConstraint( @ValidPageable(maxSize = 100) final Pageable pageable ); @@ -275,7 +275,7 @@ ResponseEntity> findPetsWithSizeConstraint( value = PetApi.PATH_FIND_PETS_WITH_SIZE_CONSTRAINT_FROM_ALL_OF_REF, produces = { "application/json" } ) - ResponseEntity> findPetsWithSizeConstraintFromAllOfRef( + @Valid ResponseEntity> findPetsWithSizeConstraintFromAllOfRef( @ValidPageable(maxSize = 75) final Pageable pageable ); @@ -291,7 +291,7 @@ ResponseEntity> findPetsWithSizeConstraintFromAllOfRef( value = PetApi.PATH_FIND_PETS_WITH_SORT_DEFAULT_ASC, produces = { "application/json" } ) - ResponseEntity> findPetsWithSortDefaultAsc( + @Valid ResponseEntity> findPetsWithSortDefaultAsc( @SortDefault.SortDefaults({@SortDefault(sort = {"id"}, direction = Sort.Direction.ASC)}) final Pageable pageable ); @@ -307,7 +307,7 @@ ResponseEntity> findPetsWithSortDefaultAsc( value = PetApi.PATH_FIND_PETS_WITH_SORT_DEFAULT_ONLY, produces = { "application/json" } ) - ResponseEntity> findPetsWithSortDefaultOnly( + @Valid ResponseEntity> findPetsWithSortDefaultOnly( @SortDefault.SortDefaults({@SortDefault(sort = {"name"}, direction = Sort.Direction.DESC)}) final Pageable pageable ); @@ -324,7 +324,7 @@ ResponseEntity> findPetsWithSortDefaultOnly( value = PetApi.PATH_FIND_PETS_WITH_SORT_ENUM, produces = { "application/json" } ) - ResponseEntity> findPetsWithSortEnum( + @Valid ResponseEntity> findPetsWithSortEnum( @Valid @RequestParam(value = "status", required = false) @Nullable String status, @ValidSort(allowedValues = {"id,asc", "id,desc", "name,asc", "name,desc"}) @PageableDefault(page = 0, size = 20) final Pageable pageable ); @@ -341,7 +341,7 @@ ResponseEntity> findPetsWithSortEnum( value = PetApi.PATH_FIND_PETS_WITHOUT_SORT_ENUM, produces = { "application/json" } ) - ResponseEntity> findPetsWithoutSortEnum( + @Valid ResponseEntity> findPetsWithoutSortEnum( @PageableDefault(page = 0, size = 20) final Pageable pageable ); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index 98c1fa9fa250..b777c4a1b6e2 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -63,7 +63,7 @@ default AnotherFakeApiDelegate getDelegate() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity call123testSpecialTags( + default @Valid ResponseEntity call123testSpecialTags( @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { return getDelegate().call123testSpecialTags(body); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java index 08fe55b0b0cb..503306482b49 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java @@ -33,7 +33,7 @@ default Optional getRequest() { * @return successful operation (status code 200) * @see AnotherFakeApi#call123testSpecialTags */ - default ResponseEntity call123testSpecialTags(Client body) { + default @Valid ResponseEntity call123testSpecialTags(Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java index 7716f62a1272..a898b7b190d7 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -101,7 +101,7 @@ default ResponseEntity createXmlItem( value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" } ) - default ResponseEntity fakeOuterBooleanSerialize( + default @Valid ResponseEntity fakeOuterBooleanSerialize( @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) @Nullable Boolean body ) { return getDelegate().fakeOuterBooleanSerialize(body); @@ -131,7 +131,7 @@ default ResponseEntity fakeOuterBooleanSerialize( value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" } ) - default ResponseEntity fakeOuterCompositeSerialize( + default @Valid ResponseEntity fakeOuterCompositeSerialize( @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) @Nullable OuterComposite body ) { return getDelegate().fakeOuterCompositeSerialize(body); @@ -161,7 +161,7 @@ default ResponseEntity fakeOuterCompositeSerialize( value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" } ) - default ResponseEntity fakeOuterNumberSerialize( + default @Valid ResponseEntity fakeOuterNumberSerialize( @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) @Nullable BigDecimal body ) { return getDelegate().fakeOuterNumberSerialize(body); @@ -191,7 +191,7 @@ default ResponseEntity fakeOuterNumberSerialize( value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" } ) - default ResponseEntity fakeOuterStringSerialize( + default @Valid ResponseEntity fakeOuterStringSerialize( @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) @Nullable String body ) { return getDelegate().fakeOuterStringSerialize(body); @@ -279,7 +279,7 @@ default ResponseEntity testBodyWithQueryParams( produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClientModel( + default @Valid ResponseEntity testClientModel( @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { return getDelegate().testClientModel(body); @@ -548,7 +548,7 @@ default ResponseEntity testQueryParameterCollectionFormat( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFileWithRequiredFile( + default @Valid ResponseEntity uploadFileWithRequiredFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java index ec87afb9fda5..f05bda3bad48 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -57,7 +57,7 @@ default ResponseEntity createXmlItem(XmlItem xmlItem) { * @return Output boolean (status code 200) * @see FakeApi#fakeOuterBooleanSerialize */ - default ResponseEntity fakeOuterBooleanSerialize(Boolean body) { + default @Valid ResponseEntity fakeOuterBooleanSerialize(Boolean body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -70,7 +70,7 @@ default ResponseEntity fakeOuterBooleanSerialize(Boolean body) { * @return Output composite (status code 200) * @see FakeApi#fakeOuterCompositeSerialize */ - default ResponseEntity fakeOuterCompositeSerialize(OuterComposite body) { + default @Valid ResponseEntity fakeOuterCompositeSerialize(OuterComposite body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { @@ -92,7 +92,7 @@ default ResponseEntity fakeOuterCompositeSerialize(OuterComposit * @return Output number (status code 200) * @see FakeApi#fakeOuterNumberSerialize */ - default ResponseEntity fakeOuterNumberSerialize(BigDecimal body) { + default @Valid ResponseEntity fakeOuterNumberSerialize(BigDecimal body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -105,7 +105,7 @@ default ResponseEntity fakeOuterNumberSerialize(BigDecimal body) { * @return Output string (status code 200) * @see FakeApi#fakeOuterStringSerialize */ - default ResponseEntity fakeOuterStringSerialize(String body) { + default @Valid ResponseEntity fakeOuterStringSerialize(String body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -145,7 +145,7 @@ default ResponseEntity testBodyWithQueryParams(String query, * @return successful operation (status code 200) * @see FakeApi#testClientModel */ - default ResponseEntity testClientModel(Client body) { + default @Valid ResponseEntity testClientModel(Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -306,7 +306,7 @@ default ResponseEntity testQueryParameterCollectionFormat(List pip * @return successful operation (status code 200) * @see FakeApi#uploadFileWithRequiredFile */ - default ResponseEntity uploadFileWithRequiredFile(Long petId, + default @Valid ResponseEntity uploadFileWithRequiredFile(Long petId, MultipartFile requiredFile, String additionalMetadata) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index acc76d2bd1a7..0b7ccf403606 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -66,7 +66,7 @@ default FakeClassnameTestApiDelegate getDelegate() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClassname( + default @Valid ResponseEntity testClassname( @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { return getDelegate().testClassname(body); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java index cb6aa4eaa70e..bdd9361bac6f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java @@ -33,7 +33,7 @@ default Optional getRequest() { * @return successful operation (status code 200) * @see FakeClassnameTestApi#testClassname */ - default ResponseEntity testClassname(Client body) { + default @Valid ResponseEntity testClassname(Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java index 6fe27bab9e34..a050f59ebe68 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApi.java @@ -140,7 +140,7 @@ default ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus( + default @Valid ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) List status, @ParameterObject final Pageable pageable ) { @@ -182,7 +182,7 @@ default ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags( + default @Valid ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) List tags, @Parameter(name = "size", description = "A test HeaderParam for issue #8315 - must NOT be removed when x-spring-paginated:true is used.", in = ParameterIn.HEADER) @RequestHeader(value = "size", required = false) @Nullable String size, @PageableDefault(page = 0, size = 20) @SortDefault.SortDefaults({@SortDefault(sort = {"id"}, direction = Sort.Direction.ASC)}) @ParameterObject final Pageable pageable @@ -223,7 +223,7 @@ default ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById( + default @Valid ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { return getDelegate().getPetById(petId); @@ -257,7 +257,7 @@ default ResponseEntity getPetById( value = PetApi.PATH_LIST_ALL_PETS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> listAllPets( + default @Valid ResponseEntity> listAllPets( @ParameterObject final Pageable pageable ) { return getDelegate().listAllPets(pageable); @@ -362,7 +362,7 @@ default ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile( + default @Valid ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiDelegate.java index 9fb0e4002a60..583f3fd2ae92 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -69,7 +69,7 @@ default ResponseEntity deletePet(Long petId, * or Invalid status value (status code 400) * @see PetApi#findPetsByStatus */ - default ResponseEntity> findPetsByStatus(List status, final Pageable pageable) { + default @Valid ResponseEntity> findPetsByStatus(List status, final Pageable pageable) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -100,7 +100,7 @@ default ResponseEntity> findPetsByStatus(List status, final Pa * @see PetApi#findPetsByTags */ @Deprecated - default ResponseEntity> findPetsByTags(List tags, + default @Valid ResponseEntity> findPetsByTags(List tags, String size, final Pageable pageable) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -130,7 +130,7 @@ default ResponseEntity> findPetsByTags(List tags, * or Pet not found (status code 404) * @see PetApi#getPetById */ - default ResponseEntity getPetById(Long petId) { + default @Valid ResponseEntity getPetById(Long petId) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -156,7 +156,7 @@ default ResponseEntity getPetById(Long petId) { * or Invalid status value (status code 400) * @see PetApi#listAllPets */ - default ResponseEntity> listAllPets(final Pageable pageable) { + default @Valid ResponseEntity> listAllPets(final Pageable pageable) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -215,7 +215,7 @@ default ResponseEntity updatePetWithForm(Long petId, * @return successful operation (status code 200) * @see PetApi#uploadFile */ - default ResponseEntity uploadFile(Long petId, + default @Valid ResponseEntity uploadFile(Long petId, String additionalMetadata, MultipartFile file) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java index e0477dad9540..350c8baaf3f7 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApi.java @@ -95,7 +95,7 @@ default ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - default ResponseEntity> getInventory( + default @Valid ResponseEntity> getInventory( ) { return getDelegate().getInventory(); @@ -131,7 +131,7 @@ default ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById( + default @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("order_id") Long orderId ) { return getDelegate().getOrderById(orderId); @@ -163,7 +163,7 @@ default ResponseEntity getOrderById( value = StoreApi.PATH_PLACE_ORDER, produces = { "application/xml", "application/json" } ) - default ResponseEntity placeOrder( + default @Valid ResponseEntity placeOrder( @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body ) { return getDelegate().placeOrder(body); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiDelegate.java index 80e109188aac..f2d49838f60f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/StoreApiDelegate.java @@ -47,7 +47,7 @@ default ResponseEntity deleteOrder(String orderId) { * @return successful operation (status code 200) * @see StoreApi#getInventory */ - default ResponseEntity> getInventory() { + default @Valid ResponseEntity> getInventory() { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -62,7 +62,7 @@ default ResponseEntity> getInventory() { * or Order not found (status code 404) * @see StoreApi#getOrderById */ - default ResponseEntity getOrderById(Long orderId) { + default @Valid ResponseEntity getOrderById(Long orderId) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -89,7 +89,7 @@ default ResponseEntity getOrderById(Long orderId) { * or Invalid Order (status code 400) * @see StoreApi#placeOrder */ - default ResponseEntity placeOrder(Order body) { + default @Valid ResponseEntity placeOrder(Order body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java index 1a64d67b8fb8..7c8ad136982f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApi.java @@ -176,7 +176,7 @@ default ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName( + default @Valid ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { return getDelegate().getUserByName(username); @@ -209,7 +209,7 @@ default ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser( + default @Valid ResponseEntity loginUser( @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ) { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiDelegate.java index c489d0f00d6c..337cb1092211 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -86,7 +86,7 @@ default ResponseEntity deleteUser(String username) { * or User not found (status code 404) * @see UserApi#getUserByName */ - default ResponseEntity getUserByName(String username) { + default @Valid ResponseEntity getUserByName(String username) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -114,7 +114,7 @@ default ResponseEntity getUserByName(String username) { * or Invalid username/password supplied (status code 400) * @see UserApi#loginUser */ - default ResponseEntity loginUser(String username, + default @Valid ResponseEntity loginUser(String username, String password) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/VersioningApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/VersioningApi.java index d9242304f752..81d2e2ab4213 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/VersioningApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/VersioningApi.java @@ -62,7 +62,7 @@ default VersioningApiDelegate getDelegate() { produces = { "*/*" }, headers = { "VersionWithDefaultValue=V1", "VersionNoDefaultValue" } ) - default ResponseEntity versioningHeaders( + default @Valid ResponseEntity versioningHeaders( @NotNull @Parameter(name = "VersionWithDefaultValue", description = "", required = true, in = ParameterIn.HEADER) @RequestHeader(value = "VersionWithDefaultValue", required = true, defaultValue = "V1") String versionWithDefaultValue, @NotNull @Parameter(name = "VersionNoDefaultValue", description = "", required = true, in = ParameterIn.HEADER) @RequestHeader(value = "VersionNoDefaultValue", required = true) String versionNoDefaultValue, @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId @@ -98,7 +98,7 @@ default ResponseEntity versioningHeaders( headers = { "VersionWithDefaultValueHeader=V1", "VersionNoDefaultValueHeader" } , params = { "VersionWithDefaultValueQuery=V1", "VersionNoDefaultValueQuery" } ) - default ResponseEntity versioningMix( + default @Valid ResponseEntity versioningMix( @NotNull @Parameter(name = "VersionWithDefaultValueQuery", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "VersionWithDefaultValueQuery", required = true, defaultValue = "V1") String versionWithDefaultValueQuery, @NotNull @Parameter(name = "VersionNoDefaultValueQuery", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "VersionNoDefaultValueQuery", required = true) String versionNoDefaultValueQuery, @NotNull @Parameter(name = "VersionWithDefaultValueHeader", description = "", required = true, in = ParameterIn.HEADER) @RequestHeader(value = "VersionWithDefaultValueHeader", required = true, defaultValue = "V1") String versionWithDefaultValueHeader, @@ -133,7 +133,7 @@ default ResponseEntity versioningMix( produces = { "*/*" }, params = { "VersionWithDefaultValue=V1", "VersionNoDefaultValue" } ) - default ResponseEntity versioningQueryParams( + default @Valid ResponseEntity versioningQueryParams( @NotNull @Parameter(name = "VersionWithDefaultValue", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "VersionWithDefaultValue", required = true, defaultValue = "V1") String versionWithDefaultValue, @NotNull @Parameter(name = "VersionNoDefaultValue", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "VersionNoDefaultValue", required = true) String versionNoDefaultValue, @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/VersioningApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/VersioningApiDelegate.java index e8acded80f07..8516ea05b58c 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/VersioningApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/api/VersioningApiDelegate.java @@ -34,7 +34,7 @@ default Optional getRequest() { * @return successful operation (status code 200) * @see VersioningApi#versioningHeaders */ - default ResponseEntity versioningHeaders(String versionWithDefaultValue, + default @Valid ResponseEntity versioningHeaders(String versionWithDefaultValue, String versionNoDefaultValue, Long petId) { getRequest().ifPresent(request -> { @@ -61,7 +61,7 @@ default ResponseEntity versioningHeaders(String versionWithDef * @return successful operation (status code 200) * @see VersioningApi#versioningMix */ - default ResponseEntity versioningMix(String versionWithDefaultValueQuery, + default @Valid ResponseEntity versioningMix(String versionWithDefaultValueQuery, String versionNoDefaultValueQuery, String versionWithDefaultValueHeader, String versionNoDefaultValueHeader, @@ -88,7 +88,7 @@ default ResponseEntity versioningMix(String versionWithDefault * @return successful operation (status code 200) * @see VersioningApi#versioningQueryParams */ - default ResponseEntity versioningQueryParams(String versionWithDefaultValue, + default @Valid ResponseEntity versioningQueryParams(String versionWithDefaultValue, String versionNoDefaultValue, Long petId) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java index 98c1fa9fa250..b777c4a1b6e2 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -63,7 +63,7 @@ default AnotherFakeApiDelegate getDelegate() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity call123testSpecialTags( + default @Valid ResponseEntity call123testSpecialTags( @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { return getDelegate().call123testSpecialTags(body); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java index 08fe55b0b0cb..503306482b49 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java @@ -33,7 +33,7 @@ default Optional getRequest() { * @return successful operation (status code 200) * @see AnotherFakeApi#call123testSpecialTags */ - default ResponseEntity call123testSpecialTags(Client body) { + default @Valid ResponseEntity call123testSpecialTags(Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java index 7716f62a1272..a898b7b190d7 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApi.java @@ -101,7 +101,7 @@ default ResponseEntity createXmlItem( value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" } ) - default ResponseEntity fakeOuterBooleanSerialize( + default @Valid ResponseEntity fakeOuterBooleanSerialize( @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) @Nullable Boolean body ) { return getDelegate().fakeOuterBooleanSerialize(body); @@ -131,7 +131,7 @@ default ResponseEntity fakeOuterBooleanSerialize( value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" } ) - default ResponseEntity fakeOuterCompositeSerialize( + default @Valid ResponseEntity fakeOuterCompositeSerialize( @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) @Nullable OuterComposite body ) { return getDelegate().fakeOuterCompositeSerialize(body); @@ -161,7 +161,7 @@ default ResponseEntity fakeOuterCompositeSerialize( value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" } ) - default ResponseEntity fakeOuterNumberSerialize( + default @Valid ResponseEntity fakeOuterNumberSerialize( @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) @Nullable BigDecimal body ) { return getDelegate().fakeOuterNumberSerialize(body); @@ -191,7 +191,7 @@ default ResponseEntity fakeOuterNumberSerialize( value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" } ) - default ResponseEntity fakeOuterStringSerialize( + default @Valid ResponseEntity fakeOuterStringSerialize( @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) @Nullable String body ) { return getDelegate().fakeOuterStringSerialize(body); @@ -279,7 +279,7 @@ default ResponseEntity testBodyWithQueryParams( produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClientModel( + default @Valid ResponseEntity testClientModel( @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { return getDelegate().testClientModel(body); @@ -548,7 +548,7 @@ default ResponseEntity testQueryParameterCollectionFormat( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFileWithRequiredFile( + default @Valid ResponseEntity uploadFileWithRequiredFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApiDelegate.java index ec87afb9fda5..f05bda3bad48 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -57,7 +57,7 @@ default ResponseEntity createXmlItem(XmlItem xmlItem) { * @return Output boolean (status code 200) * @see FakeApi#fakeOuterBooleanSerialize */ - default ResponseEntity fakeOuterBooleanSerialize(Boolean body) { + default @Valid ResponseEntity fakeOuterBooleanSerialize(Boolean body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -70,7 +70,7 @@ default ResponseEntity fakeOuterBooleanSerialize(Boolean body) { * @return Output composite (status code 200) * @see FakeApi#fakeOuterCompositeSerialize */ - default ResponseEntity fakeOuterCompositeSerialize(OuterComposite body) { + default @Valid ResponseEntity fakeOuterCompositeSerialize(OuterComposite body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { @@ -92,7 +92,7 @@ default ResponseEntity fakeOuterCompositeSerialize(OuterComposit * @return Output number (status code 200) * @see FakeApi#fakeOuterNumberSerialize */ - default ResponseEntity fakeOuterNumberSerialize(BigDecimal body) { + default @Valid ResponseEntity fakeOuterNumberSerialize(BigDecimal body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -105,7 +105,7 @@ default ResponseEntity fakeOuterNumberSerialize(BigDecimal body) { * @return Output string (status code 200) * @see FakeApi#fakeOuterStringSerialize */ - default ResponseEntity fakeOuterStringSerialize(String body) { + default @Valid ResponseEntity fakeOuterStringSerialize(String body) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -145,7 +145,7 @@ default ResponseEntity testBodyWithQueryParams(String query, * @return successful operation (status code 200) * @see FakeApi#testClientModel */ - default ResponseEntity testClientModel(Client body) { + default @Valid ResponseEntity testClientModel(Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -306,7 +306,7 @@ default ResponseEntity testQueryParameterCollectionFormat(List pip * @return successful operation (status code 200) * @see FakeApi#uploadFileWithRequiredFile */ - default ResponseEntity uploadFileWithRequiredFile(Long petId, + default @Valid ResponseEntity uploadFileWithRequiredFile(Long petId, MultipartFile requiredFile, String additionalMetadata) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index acc76d2bd1a7..0b7ccf403606 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -66,7 +66,7 @@ default FakeClassnameTestApiDelegate getDelegate() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClassname( + default @Valid ResponseEntity testClassname( @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { return getDelegate().testClassname(body); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java index cb6aa4eaa70e..bdd9361bac6f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java @@ -33,7 +33,7 @@ default Optional getRequest() { * @return successful operation (status code 200) * @see FakeClassnameTestApi#testClassname */ - default ResponseEntity testClassname(Client body) { + default @Valid ResponseEntity testClassname(Client body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java index 6fe27bab9e34..a050f59ebe68 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApi.java @@ -140,7 +140,7 @@ default ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus( + default @Valid ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) List status, @ParameterObject final Pageable pageable ) { @@ -182,7 +182,7 @@ default ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags( + default @Valid ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) List tags, @Parameter(name = "size", description = "A test HeaderParam for issue #8315 - must NOT be removed when x-spring-paginated:true is used.", in = ParameterIn.HEADER) @RequestHeader(value = "size", required = false) @Nullable String size, @PageableDefault(page = 0, size = 20) @SortDefault.SortDefaults({@SortDefault(sort = {"id"}, direction = Sort.Direction.ASC)}) @ParameterObject final Pageable pageable @@ -223,7 +223,7 @@ default ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById( + default @Valid ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { return getDelegate().getPetById(petId); @@ -257,7 +257,7 @@ default ResponseEntity getPetById( value = PetApi.PATH_LIST_ALL_PETS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> listAllPets( + default @Valid ResponseEntity> listAllPets( @ParameterObject final Pageable pageable ) { return getDelegate().listAllPets(pageable); @@ -362,7 +362,7 @@ default ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile( + default @Valid ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApiDelegate.java index 9fb0e4002a60..583f3fd2ae92 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -69,7 +69,7 @@ default ResponseEntity deletePet(Long petId, * or Invalid status value (status code 400) * @see PetApi#findPetsByStatus */ - default ResponseEntity> findPetsByStatus(List status, final Pageable pageable) { + default @Valid ResponseEntity> findPetsByStatus(List status, final Pageable pageable) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -100,7 +100,7 @@ default ResponseEntity> findPetsByStatus(List status, final Pa * @see PetApi#findPetsByTags */ @Deprecated - default ResponseEntity> findPetsByTags(List tags, + default @Valid ResponseEntity> findPetsByTags(List tags, String size, final Pageable pageable) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -130,7 +130,7 @@ default ResponseEntity> findPetsByTags(List tags, * or Pet not found (status code 404) * @see PetApi#getPetById */ - default ResponseEntity getPetById(Long petId) { + default @Valid ResponseEntity getPetById(Long petId) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -156,7 +156,7 @@ default ResponseEntity getPetById(Long petId) { * or Invalid status value (status code 400) * @see PetApi#listAllPets */ - default ResponseEntity> listAllPets(final Pageable pageable) { + default @Valid ResponseEntity> listAllPets(final Pageable pageable) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -215,7 +215,7 @@ default ResponseEntity updatePetWithForm(Long petId, * @return successful operation (status code 200) * @see PetApi#uploadFile */ - default ResponseEntity uploadFile(Long petId, + default @Valid ResponseEntity uploadFile(Long petId, String additionalMetadata, MultipartFile file) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java index e0477dad9540..350c8baaf3f7 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApi.java @@ -95,7 +95,7 @@ default ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - default ResponseEntity> getInventory( + default @Valid ResponseEntity> getInventory( ) { return getDelegate().getInventory(); @@ -131,7 +131,7 @@ default ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById( + default @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("order_id") Long orderId ) { return getDelegate().getOrderById(orderId); @@ -163,7 +163,7 @@ default ResponseEntity getOrderById( value = StoreApi.PATH_PLACE_ORDER, produces = { "application/xml", "application/json" } ) - default ResponseEntity placeOrder( + default @Valid ResponseEntity placeOrder( @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body ) { return getDelegate().placeOrder(body); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApiDelegate.java index 80e109188aac..f2d49838f60f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/StoreApiDelegate.java @@ -47,7 +47,7 @@ default ResponseEntity deleteOrder(String orderId) { * @return successful operation (status code 200) * @see StoreApi#getInventory */ - default ResponseEntity> getInventory() { + default @Valid ResponseEntity> getInventory() { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -62,7 +62,7 @@ default ResponseEntity> getInventory() { * or Order not found (status code 404) * @see StoreApi#getOrderById */ - default ResponseEntity getOrderById(Long orderId) { + default @Valid ResponseEntity getOrderById(Long orderId) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -89,7 +89,7 @@ default ResponseEntity getOrderById(Long orderId) { * or Invalid Order (status code 400) * @see StoreApi#placeOrder */ - default ResponseEntity placeOrder(Order body) { + default @Valid ResponseEntity placeOrder(Order body) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java index 1a64d67b8fb8..7c8ad136982f 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApi.java @@ -176,7 +176,7 @@ default ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName( + default @Valid ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { return getDelegate().getUserByName(username); @@ -209,7 +209,7 @@ default ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser( + default @Valid ResponseEntity loginUser( @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ) { diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApiDelegate.java index c489d0f00d6c..337cb1092211 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -86,7 +86,7 @@ default ResponseEntity deleteUser(String username) { * or User not found (status code 404) * @see UserApi#getUserByName */ - default ResponseEntity getUserByName(String username) { + default @Valid ResponseEntity getUserByName(String username) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -114,7 +114,7 @@ default ResponseEntity getUserByName(String username) { * or Invalid username/password supplied (status code 400) * @see UserApi#loginUser */ - default ResponseEntity loginUser(String username, + default @Valid ResponseEntity loginUser(String username, String password) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/VersioningApi.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/VersioningApi.java index b6506e9402d2..7ce743ae329c 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/VersioningApi.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/VersioningApi.java @@ -64,7 +64,7 @@ default VersioningApiDelegate getDelegate() { produces = { "*/*" }, headers = { "VersionWithDefaultValue=V1", "VersionNoDefaultValue" } ) - default ResponseEntity versioningHeaders( + default @Valid ResponseEntity versioningHeaders( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { return getDelegate().versioningHeaders(petId); @@ -100,7 +100,7 @@ default ResponseEntity versioningHeaders( headers = { "VersionWithDefaultValueHeader=V1", "VersionNoDefaultValueHeader" } , params = { "VersionWithDefaultValueQuery=V1", "VersionNoDefaultValueQuery" } ) - default ResponseEntity versioningMix( + default @Valid ResponseEntity versioningMix( @NotNull @Parameter(name = "VersionWithDefaultValueQuery", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "VersionWithDefaultValueQuery", required = true, defaultValue = "V1") String versionWithDefaultValueQuery, @NotNull @Parameter(name = "VersionNoDefaultValueQuery", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "VersionNoDefaultValueQuery", required = true) String versionNoDefaultValueQuery, @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId @@ -133,7 +133,7 @@ default ResponseEntity versioningMix( produces = { "*/*" }, params = { "VersionWithDefaultValue=V1", "VersionNoDefaultValue" } ) - default ResponseEntity versioningQueryParams( + default @Valid ResponseEntity versioningQueryParams( @NotNull @Parameter(name = "VersionWithDefaultValue", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "VersionWithDefaultValue", required = true, defaultValue = "V1") String versionWithDefaultValue, @NotNull @Parameter(name = "VersionNoDefaultValue", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "VersionNoDefaultValue", required = true) String versionNoDefaultValue, @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/VersioningApiDelegate.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/VersioningApiDelegate.java index 1d6abd5230f1..82a51b11bc5b 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/VersioningApiDelegate.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/api/VersioningApiDelegate.java @@ -32,7 +32,7 @@ default Optional getRequest() { * @return successful operation (status code 200) * @see VersioningApi#versioningHeaders */ - default ResponseEntity versioningHeaders(Long petId) { + default @Valid ResponseEntity versioningHeaders(Long petId) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { @@ -55,7 +55,7 @@ default ResponseEntity versioningHeaders(Long petId) { * @return successful operation (status code 200) * @see VersioningApi#versioningMix */ - default ResponseEntity versioningMix(String versionWithDefaultValueQuery, + default @Valid ResponseEntity versioningMix(String versionWithDefaultValueQuery, String versionNoDefaultValueQuery, Long petId) { getRequest().ifPresent(request -> { @@ -80,7 +80,7 @@ default ResponseEntity versioningMix(String versionWithDefault * @return successful operation (status code 200) * @see VersioningApi#versioningQueryParams */ - default ResponseEntity versioningQueryParams(String versionWithDefaultValue, + default @Valid ResponseEntity versioningQueryParams(String versionWithDefaultValue, String versionNoDefaultValue, Long petId) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index d5ca6053668a..7b3a7368c242 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -67,7 +67,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity call123testSpecialTags( + default @Valid ResponseEntity call123testSpecialTags( @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java index 155c2a89967c..b3bbfb2e9bcb 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -106,7 +106,7 @@ default ResponseEntity createXmlItem( value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" } ) - default ResponseEntity fakeOuterBooleanSerialize( + default @Valid ResponseEntity fakeOuterBooleanSerialize( @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) @Nullable Boolean body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -137,7 +137,7 @@ default ResponseEntity fakeOuterBooleanSerialize( value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" } ) - default ResponseEntity fakeOuterCompositeSerialize( + default @Valid ResponseEntity fakeOuterCompositeSerialize( @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) @Nullable OuterComposite body ) { getRequest().ifPresent(request -> { @@ -177,7 +177,7 @@ default ResponseEntity fakeOuterCompositeSerialize( value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" } ) - default ResponseEntity fakeOuterNumberSerialize( + default @Valid ResponseEntity fakeOuterNumberSerialize( @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) @Nullable BigDecimal body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -208,7 +208,7 @@ default ResponseEntity fakeOuterNumberSerialize( value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" } ) - default ResponseEntity fakeOuterStringSerialize( + default @Valid ResponseEntity fakeOuterStringSerialize( @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) @Nullable String body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -299,7 +299,7 @@ default ResponseEntity testBodyWithQueryParams( produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClientModel( + default @Valid ResponseEntity testClientModel( @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { getRequest().ifPresent(request -> { @@ -584,7 +584,7 @@ default ResponseEntity testQueryParameterCollectionFormat( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFileWithRequiredFile( + default @Valid ResponseEntity uploadFileWithRequiredFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 04a09db68d8e..726d4ce86e48 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -70,7 +70,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClassname( + default @Valid ResponseEntity testClassname( @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java index d53822aeaf43..9891517206e2 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/PetApi.java @@ -146,7 +146,7 @@ default ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus( + default @Valid ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) List status, @ParameterObject final Pageable pageable ) { @@ -203,7 +203,7 @@ default ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags( + default @Valid ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) List tags, @Parameter(name = "size", description = "A test HeaderParam for issue #8315 - must NOT be removed when x-spring-paginated:true is used.", in = ParameterIn.HEADER) @RequestHeader(value = "size", required = false) @Nullable String size, @PageableDefault(page = 0, size = 20) @SortDefault.SortDefaults({@SortDefault(sort = {"id"}, direction = Sort.Direction.ASC)}) @ParameterObject final Pageable pageable @@ -259,7 +259,7 @@ default ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById( + default @Valid ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { getRequest().ifPresent(request -> { @@ -308,7 +308,7 @@ default ResponseEntity getPetById( value = PetApi.PATH_LIST_ALL_PETS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> listAllPets( + default @Valid ResponseEntity> listAllPets( @ParameterObject final Pageable pageable ) { getRequest().ifPresent(request -> { @@ -430,7 +430,7 @@ default ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile( + default @Valid ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java index 67f591d7da3b..c226188af654 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/StoreApi.java @@ -100,7 +100,7 @@ default ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - default ResponseEntity> getInventory( + default @Valid ResponseEntity> getInventory( ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -137,7 +137,7 @@ default ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById( + default @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("order_id") Long orderId ) { getRequest().ifPresent(request -> { @@ -184,7 +184,7 @@ default ResponseEntity getOrderById( value = StoreApi.PATH_PLACE_ORDER, produces = { "application/xml", "application/json" } ) - default ResponseEntity placeOrder( + default @Valid ResponseEntity placeOrder( @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body ) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java index 0e9e27c9d910..7919feb573be 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/UserApi.java @@ -184,7 +184,7 @@ default ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName( + default @Valid ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { getRequest().ifPresent(request -> { @@ -232,7 +232,7 @@ default ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser( + default @Valid ResponseEntity loginUser( @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ) { diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/VersioningApi.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/VersioningApi.java index 500f4ba49584..052e21ad7f50 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/VersioningApi.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/api/VersioningApi.java @@ -66,7 +66,7 @@ default Optional getRequest() { produces = { "*/*" }, headers = { "VersionWithDefaultValue=V1", "VersionNoDefaultValue" } ) - default ResponseEntity versioningHeaders( + default @Valid ResponseEntity versioningHeaders( @NotNull @Parameter(name = "VersionWithDefaultValue", description = "", required = true, in = ParameterIn.HEADER) @RequestHeader(value = "VersionWithDefaultValue", required = true, defaultValue = "V1") String versionWithDefaultValue, @NotNull @Parameter(name = "VersionNoDefaultValue", description = "", required = true, in = ParameterIn.HEADER) @RequestHeader(value = "VersionNoDefaultValue", required = true) String versionNoDefaultValue, @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId @@ -112,7 +112,7 @@ default ResponseEntity versioningHeaders( headers = { "VersionWithDefaultValueHeader=V1", "VersionNoDefaultValueHeader" } , params = { "VersionWithDefaultValueQuery=V1", "VersionNoDefaultValueQuery" } ) - default ResponseEntity versioningMix( + default @Valid ResponseEntity versioningMix( @NotNull @Parameter(name = "VersionWithDefaultValueQuery", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "VersionWithDefaultValueQuery", required = true, defaultValue = "V1") String versionWithDefaultValueQuery, @NotNull @Parameter(name = "VersionNoDefaultValueQuery", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "VersionNoDefaultValueQuery", required = true) String versionNoDefaultValueQuery, @NotNull @Parameter(name = "VersionWithDefaultValueHeader", description = "", required = true, in = ParameterIn.HEADER) @RequestHeader(value = "VersionWithDefaultValueHeader", required = true, defaultValue = "V1") String versionWithDefaultValueHeader, @@ -157,7 +157,7 @@ default ResponseEntity versioningMix( produces = { "*/*" }, params = { "VersionWithDefaultValue=V1", "VersionNoDefaultValue" } ) - default ResponseEntity versioningQueryParams( + default @Valid ResponseEntity versioningQueryParams( @NotNull @Parameter(name = "VersionWithDefaultValue", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "VersionWithDefaultValue", required = true, defaultValue = "V1") String versionWithDefaultValue, @NotNull @Parameter(name = "VersionNoDefaultValue", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "VersionNoDefaultValue", required = true) String versionNoDefaultValue, @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java index d5ca6053668a..7b3a7368c242 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -67,7 +67,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity call123testSpecialTags( + default @Valid ResponseEntity call123testSpecialTags( @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java index 155c2a89967c..b3bbfb2e9bcb 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeApi.java @@ -106,7 +106,7 @@ default ResponseEntity createXmlItem( value = FakeApi.PATH_FAKE_OUTER_BOOLEAN_SERIALIZE, produces = { "*/*" } ) - default ResponseEntity fakeOuterBooleanSerialize( + default @Valid ResponseEntity fakeOuterBooleanSerialize( @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) @Nullable Boolean body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -137,7 +137,7 @@ default ResponseEntity fakeOuterBooleanSerialize( value = FakeApi.PATH_FAKE_OUTER_COMPOSITE_SERIALIZE, produces = { "*/*" } ) - default ResponseEntity fakeOuterCompositeSerialize( + default @Valid ResponseEntity fakeOuterCompositeSerialize( @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) @Nullable OuterComposite body ) { getRequest().ifPresent(request -> { @@ -177,7 +177,7 @@ default ResponseEntity fakeOuterCompositeSerialize( value = FakeApi.PATH_FAKE_OUTER_NUMBER_SERIALIZE, produces = { "*/*" } ) - default ResponseEntity fakeOuterNumberSerialize( + default @Valid ResponseEntity fakeOuterNumberSerialize( @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) @Nullable BigDecimal body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -208,7 +208,7 @@ default ResponseEntity fakeOuterNumberSerialize( value = FakeApi.PATH_FAKE_OUTER_STRING_SERIALIZE, produces = { "*/*" } ) - default ResponseEntity fakeOuterStringSerialize( + default @Valid ResponseEntity fakeOuterStringSerialize( @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) @Nullable String body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -299,7 +299,7 @@ default ResponseEntity testBodyWithQueryParams( produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClientModel( + default @Valid ResponseEntity testClientModel( @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { getRequest().ifPresent(request -> { @@ -584,7 +584,7 @@ default ResponseEntity testQueryParameterCollectionFormat( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFileWithRequiredFile( + default @Valid ResponseEntity uploadFileWithRequiredFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 04a09db68d8e..726d4ce86e48 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -70,7 +70,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClassname( + default @Valid ResponseEntity testClassname( @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body ) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java index d53822aeaf43..9891517206e2 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/PetApi.java @@ -146,7 +146,7 @@ default ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus( + default @Valid ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) List status, @ParameterObject final Pageable pageable ) { @@ -203,7 +203,7 @@ default ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags( + default @Valid ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) List tags, @Parameter(name = "size", description = "A test HeaderParam for issue #8315 - must NOT be removed when x-spring-paginated:true is used.", in = ParameterIn.HEADER) @RequestHeader(value = "size", required = false) @Nullable String size, @PageableDefault(page = 0, size = 20) @SortDefault.SortDefaults({@SortDefault(sort = {"id"}, direction = Sort.Direction.ASC)}) @ParameterObject final Pageable pageable @@ -259,7 +259,7 @@ default ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById( + default @Valid ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { getRequest().ifPresent(request -> { @@ -308,7 +308,7 @@ default ResponseEntity getPetById( value = PetApi.PATH_LIST_ALL_PETS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> listAllPets( + default @Valid ResponseEntity> listAllPets( @ParameterObject final Pageable pageable ) { getRequest().ifPresent(request -> { @@ -430,7 +430,7 @@ default ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile( + default @Valid ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java index 67f591d7da3b..c226188af654 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/StoreApi.java @@ -100,7 +100,7 @@ default ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - default ResponseEntity> getInventory( + default @Valid ResponseEntity> getInventory( ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -137,7 +137,7 @@ default ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById( + default @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("order_id") Long orderId ) { getRequest().ifPresent(request -> { @@ -184,7 +184,7 @@ default ResponseEntity getOrderById( value = StoreApi.PATH_PLACE_ORDER, produces = { "application/xml", "application/json" } ) - default ResponseEntity placeOrder( + default @Valid ResponseEntity placeOrder( @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body ) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java index 0e9e27c9d910..7919feb573be 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/UserApi.java @@ -184,7 +184,7 @@ default ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName( + default @Valid ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { getRequest().ifPresent(request -> { @@ -232,7 +232,7 @@ default ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser( + default @Valid ResponseEntity loginUser( @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ) { diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/VersioningApi.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/VersioningApi.java index 14c9a072c382..98b6554efb93 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/VersioningApi.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/api/VersioningApi.java @@ -68,7 +68,7 @@ default Optional getRequest() { produces = { "*/*" }, headers = { "VersionWithDefaultValue=V1", "VersionNoDefaultValue" } ) - default ResponseEntity versioningHeaders( + default @Valid ResponseEntity versioningHeaders( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { getRequest().ifPresent(request -> { @@ -114,7 +114,7 @@ default ResponseEntity versioningHeaders( headers = { "VersionWithDefaultValueHeader=V1", "VersionNoDefaultValueHeader" } , params = { "VersionWithDefaultValueQuery=V1", "VersionNoDefaultValueQuery" } ) - default ResponseEntity versioningMix( + default @Valid ResponseEntity versioningMix( @NotNull @Parameter(name = "VersionWithDefaultValueQuery", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "VersionWithDefaultValueQuery", required = true, defaultValue = "V1") String versionWithDefaultValueQuery, @NotNull @Parameter(name = "VersionNoDefaultValueQuery", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "VersionNoDefaultValueQuery", required = true) String versionNoDefaultValueQuery, @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId @@ -157,7 +157,7 @@ default ResponseEntity versioningMix( produces = { "*/*" }, params = { "VersionWithDefaultValue=V1", "VersionNoDefaultValue" } ) - default ResponseEntity versioningQueryParams( + default @Valid ResponseEntity versioningQueryParams( @NotNull @Parameter(name = "VersionWithDefaultValue", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "VersionWithDefaultValue", required = true, defaultValue = "V1") String versionWithDefaultValue, @NotNull @Parameter(name = "VersionNoDefaultValue", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "VersionNoDefaultValue", required = true) String versionNoDefaultValue, @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId diff --git a/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/api/UserApi.java index 78a88c82e195..f40134c84428 100644 --- a/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-spring-provide-args/src/main/java/org/openapitools/api/UserApi.java @@ -72,7 +72,7 @@ default Optional getRequest() { value = UserApi.PATH_LOGIN_USER, produces = { "application/json" } ) - default ResponseEntity loginUser( + default @Valid ResponseEntity loginUser( @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password, @Parameter(hidden = true) @Value("${server.port}") String someValue, diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java index c7d3b596ff27..359d1cb80252 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -67,7 +67,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity call123testSpecialTags( + default @Valid ResponseEntity call123testSpecialTags( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java index 85832d28b5ea..ac262e62e7e0 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java @@ -109,7 +109,7 @@ default ResponseEntity createXmlItem( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterBooleanSerialize( + default @Valid ResponseEntity fakeOuterBooleanSerialize( @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Optional body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -141,7 +141,7 @@ default ResponseEntity fakeOuterBooleanSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterCompositeSerialize( + default @Valid ResponseEntity fakeOuterCompositeSerialize( @Parameter(name = "OuterComposite", description = "Input composite as post body") @Valid @RequestBody(required = false) Optional outerComposite ) { getRequest().ifPresent(request -> { @@ -182,7 +182,7 @@ default ResponseEntity fakeOuterCompositeSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterNumberSerialize( + default @Valid ResponseEntity fakeOuterNumberSerialize( @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) Optional body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -214,7 +214,7 @@ default ResponseEntity fakeOuterNumberSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterStringSerialize( + default @Valid ResponseEntity fakeOuterStringSerialize( @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) Optional body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -243,7 +243,7 @@ default ResponseEntity fakeOuterStringSerialize( value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) - default ResponseEntity responseObjectDifferentNames( + default @Valid ResponseEntity responseObjectDifferentNames( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { getRequest().ifPresent(request -> { @@ -343,7 +343,7 @@ default ResponseEntity testBodyWithQueryParams( produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClientModel( + default @Valid ResponseEntity testClientModel( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { @@ -654,7 +654,7 @@ default ResponseEntity testQueryParameterCollectionFormat( value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) - default ResponseEntity testWithResultExample( + default @Valid ResponseEntity testWithResultExample( ) { getRequest().ifPresent(request -> { @@ -701,7 +701,7 @@ default ResponseEntity testWithResultExample( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFileWithRequiredFile( + default @Valid ResponseEntity uploadFileWithRequiredFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) Optional additionalMetadata diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index d276d199d029..41b703bf6839 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -70,7 +70,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClassname( + default @Valid ResponseEntity testClassname( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java index ffb310fba4a3..d761c81d9cdd 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java @@ -146,7 +146,7 @@ default ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus( + default @Valid ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) List status ) { getRequest().ifPresent(request -> { @@ -201,7 +201,7 @@ default ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags( + default @Valid ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) Set tags ) { getRequest().ifPresent(request -> { @@ -255,7 +255,7 @@ default ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById( + default @Valid ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { getRequest().ifPresent(request -> { @@ -383,7 +383,7 @@ default ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile( + default @Valid ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @RequestParam(value = "additionalMetadata", required = false) Optional additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java index bb9732678b51..9ce26f80b655 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java @@ -100,7 +100,7 @@ default ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - default ResponseEntity> getInventory( + default @Valid ResponseEntity> getInventory( ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -137,7 +137,7 @@ default ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById( + default @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("order_id") Long orderId ) { getRequest().ifPresent(request -> { @@ -187,7 +187,7 @@ default ResponseEntity getOrderById( produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) - default ResponseEntity placeOrder( + default @Valid ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java index bf58d111c614..a848e02a8cf1 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java @@ -193,7 +193,7 @@ default ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName( + default @Valid ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { getRequest().ifPresent(request -> { @@ -243,7 +243,7 @@ default ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser( + default @Valid ResponseEntity loginUser( @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ) { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java index a84a38ce5375..e3aacef926ad 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java @@ -71,7 +71,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity call123testSpecialTags( + default @Valid ResponseEntity call123testSpecialTags( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java index ce9b342f9fc3..728011dfc1bc 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java @@ -114,7 +114,7 @@ default ResponseEntity createXmlItem( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterBooleanSerialize( + default @Valid ResponseEntity fakeOuterBooleanSerialize( @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) @Nullable Boolean body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -147,7 +147,7 @@ default ResponseEntity fakeOuterBooleanSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterCompositeSerialize( + default @Valid ResponseEntity fakeOuterCompositeSerialize( @Parameter(name = "OuterComposite", description = "Input composite as post body") @Valid @RequestBody(required = false) @Nullable OuterComposite outerComposite ) { getRequest().ifPresent(request -> { @@ -189,7 +189,7 @@ default ResponseEntity fakeOuterCompositeSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterNumberSerialize( + default @Valid ResponseEntity fakeOuterNumberSerialize( @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) @Nullable BigDecimal body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -222,7 +222,7 @@ default ResponseEntity fakeOuterNumberSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterStringSerialize( + default @Valid ResponseEntity fakeOuterStringSerialize( @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) @Nullable String body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -252,7 +252,7 @@ default ResponseEntity fakeOuterStringSerialize( value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) - default ResponseEntity responseObjectDifferentNames( + default @Valid ResponseEntity responseObjectDifferentNames( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { getRequest().ifPresent(request -> { @@ -355,7 +355,7 @@ default ResponseEntity testBodyWithQueryParams( produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClientModel( + default @Valid ResponseEntity testClientModel( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { @@ -674,7 +674,7 @@ default ResponseEntity testQueryParameterCollectionFormat( value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) - default ResponseEntity testWithResultExample( + default @Valid ResponseEntity testWithResultExample( ) { getRequest().ifPresent(request -> { @@ -722,7 +722,7 @@ default ResponseEntity testWithResultExample( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFileWithRequiredFile( + default @Valid ResponseEntity uploadFileWithRequiredFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java index 6c3da2979465..adc06258f9c4 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java @@ -74,7 +74,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClassname( + default @Valid ResponseEntity testClassname( @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java index 0b378ba8da93..1a4b7ba068ac 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java @@ -152,7 +152,7 @@ default ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus( + default @Valid ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) List status ) { getRequest().ifPresent(request -> { @@ -208,7 +208,7 @@ default ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags( + default @Valid ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) Set tags ) { getRequest().ifPresent(request -> { @@ -263,7 +263,7 @@ default ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById( + default @Valid ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { getRequest().ifPresent(request -> { @@ -394,7 +394,7 @@ default ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile( + default @Valid ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java index b8f39303cd60..fa2dd64232f9 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java @@ -105,7 +105,7 @@ default ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - default ResponseEntity> getInventory( + default @Valid ResponseEntity> getInventory( ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -143,7 +143,7 @@ default ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById( + default @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("order_id") Long orderId ) { getRequest().ifPresent(request -> { @@ -194,7 +194,7 @@ default ResponseEntity getOrderById( produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) - default ResponseEntity placeOrder( + default @Valid ResponseEntity placeOrder( @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java index 7ab27df028e8..c1c6e6a6ad6f 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java @@ -201,7 +201,7 @@ default ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName( + default @Valid ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { getRequest().ifPresent(request -> { @@ -252,7 +252,7 @@ default ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser( + default @Valid ResponseEntity loginUser( @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ) { diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/AnotherFakeApi.java index 540580e36972..25de9685465a 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -67,7 +67,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity call123testSpecialTags( + default @Valid ResponseEntity call123testSpecialTags( @Parameter(name = "ClientDto", description = "client model", required = true) @NotNull @Valid @RequestBody ClientDto clientDto ) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeApi.java index 90fbb1f4ec55..508f8618bcf6 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeApi.java @@ -81,7 +81,7 @@ default Optional getRequest() { value = FakeApi.PATH_FAKE_BIG_DECIMAL_MAP, produces = { "*/*" } ) - default ResponseEntity fakeBigDecimalMap( + default @Valid ResponseEntity fakeBigDecimalMap( ) { getRequest().ifPresent(request -> { @@ -119,7 +119,7 @@ default ResponseEntity fakeBigDecimalMap( value = FakeApi.PATH_FAKE_HEALTH_GET, produces = { "application/json" } ) - default ResponseEntity fakeHealthGet( + default @Valid ResponseEntity fakeHealthGet( ) { getRequest().ifPresent(request -> { @@ -195,7 +195,7 @@ default ResponseEntity fakeHttpSignatureTest( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterBooleanSerialize( + default @Valid ResponseEntity fakeOuterBooleanSerialize( @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) @Nullable Boolean body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -227,7 +227,7 @@ default ResponseEntity fakeOuterBooleanSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterCompositeSerialize( + default @Valid ResponseEntity fakeOuterCompositeSerialize( @Parameter(name = "OuterCompositeDto", description = "Input composite as post body") @Valid @RequestBody(required = false) @Nullable OuterCompositeDto outerCompositeDto ) { getRequest().ifPresent(request -> { @@ -268,7 +268,7 @@ default ResponseEntity fakeOuterCompositeSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterNumberSerialize( + default @Valid ResponseEntity fakeOuterNumberSerialize( @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) @Nullable BigDecimal body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -300,7 +300,7 @@ default ResponseEntity fakeOuterNumberSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterStringSerialize( + default @Valid ResponseEntity fakeOuterStringSerialize( @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) @Nullable String body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -332,7 +332,7 @@ default ResponseEntity fakeOuterStringSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakePropertyEnumIntegerSerialize( + default @Valid ResponseEntity fakePropertyEnumIntegerSerialize( @Parameter(name = "OuterObjectWithEnumPropertyDto", description = "Input enum (int) as post body", required = true) @NotNull @Valid @RequestBody OuterObjectWithEnumPropertyDto outerObjectWithEnumPropertyDto ) { getRequest().ifPresent(request -> { @@ -491,7 +491,7 @@ default ResponseEntity testBodyWithQueryParams( produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClientModel( + default @Valid ResponseEntity testClientModel( @Parameter(name = "ClientDto", description = "client model", required = true) @NotNull @Valid @RequestBody ClientDto clientDto ) { getRequest().ifPresent(request -> { @@ -881,7 +881,7 @@ default ResponseEntity testStringMapReference( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFileWithRequiredFile( + default @Valid ResponseEntity uploadFileWithRequiredFile( @NotNull @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 6a899094e5b6..eb49212cfb48 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -70,7 +70,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClassname( + default @Valid ResponseEntity testClassname( @Parameter(name = "ClientDto", description = "client model", required = true) @NotNull @Valid @RequestBody ClientDto clientDto ) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FooApi.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FooApi.java index 40c1971af900..9c20ed0827ff 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FooApi.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/FooApi.java @@ -61,7 +61,7 @@ default Optional getRequest() { value = FooApi.PATH_FOO_GET, produces = { "application/json" } ) - default ResponseEntity fooGet( + default @Valid ResponseEntity fooGet( ) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/PetApi.java index fc69ddb4a6f9..bd889fdb6b3f 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/PetApi.java @@ -146,7 +146,7 @@ default ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus( + default @Valid ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", deprecated = true, description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) @Deprecated List status ) { getRequest().ifPresent(request -> { @@ -201,7 +201,7 @@ default ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags( + default @Valid ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) Set tags ) { getRequest().ifPresent(request -> { @@ -255,7 +255,7 @@ default ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById( + default @Valid ResponseEntity getPetById( @NotNull @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { getRequest().ifPresent(request -> { @@ -385,7 +385,7 @@ default ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile( + default @Valid ResponseEntity uploadFile( @NotNull @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/StoreApi.java index c16cb29a2c33..bb600898910a 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/StoreApi.java @@ -100,7 +100,7 @@ default ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - default ResponseEntity> getInventory( + default @Valid ResponseEntity> getInventory( ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -137,7 +137,7 @@ default ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById( + default @Valid ResponseEntity getOrderById( @NotNull @Min(value = 1L) @Max(value = 5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("order_id") Long orderId ) { getRequest().ifPresent(request -> { @@ -187,7 +187,7 @@ default ResponseEntity getOrderById( produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) - default ResponseEntity placeOrder( + default @Valid ResponseEntity placeOrder( @Parameter(name = "OrderDto", description = "order placed for purchasing the pet", required = true) @NotNull @Valid @RequestBody OrderDto orderDto ) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/UserApi.java index 41bc08b5519d..b999cc9da984 100644 --- a/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-x-implements-skip/src/main/java/org/openapitools/api/UserApi.java @@ -193,7 +193,7 @@ default ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName( + default @Valid ResponseEntity getUserByName( @NotNull @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { getRequest().ifPresent(request -> { @@ -243,7 +243,7 @@ default ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser( + default @Valid ResponseEntity loginUser( @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ) { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java index f53826d932c7..8e26a0a86cbb 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -67,7 +67,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity call123testSpecialTags( + default @Valid ResponseEntity call123testSpecialTags( @Parameter(name = "ClientDto", description = "client model", required = true) @Valid @RequestBody ClientDto clientDto ) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java index bb3e88a24adb..e4636516fbc5 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java @@ -109,7 +109,7 @@ default ResponseEntity createXmlItem( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterBooleanSerialize( + default @Valid ResponseEntity fakeOuterBooleanSerialize( @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) @Nullable Boolean body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -141,7 +141,7 @@ default ResponseEntity fakeOuterBooleanSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterCompositeSerialize( + default @Valid ResponseEntity fakeOuterCompositeSerialize( @Parameter(name = "OuterCompositeDto", description = "Input composite as post body") @Valid @RequestBody(required = false) @Nullable OuterCompositeDto outerCompositeDto ) { getRequest().ifPresent(request -> { @@ -182,7 +182,7 @@ default ResponseEntity fakeOuterCompositeSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterNumberSerialize( + default @Valid ResponseEntity fakeOuterNumberSerialize( @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) @Nullable BigDecimal body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -214,7 +214,7 @@ default ResponseEntity fakeOuterNumberSerialize( produces = { "*/*" }, consumes = { "application/json" } ) - default ResponseEntity fakeOuterStringSerialize( + default @Valid ResponseEntity fakeOuterStringSerialize( @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) @Nullable String body ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -243,7 +243,7 @@ default ResponseEntity fakeOuterStringSerialize( value = FakeApi.PATH_RESPONSE_OBJECT_DIFFERENT_NAMES, produces = { "application/json" } ) - default ResponseEntity responseObjectDifferentNames( + default @Valid ResponseEntity responseObjectDifferentNames( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { getRequest().ifPresent(request -> { @@ -343,7 +343,7 @@ default ResponseEntity testBodyWithQueryParams( produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClientModel( + default @Valid ResponseEntity testClientModel( @Parameter(name = "ClientDto", description = "client model", required = true) @Valid @RequestBody ClientDto clientDto ) { getRequest().ifPresent(request -> { @@ -654,7 +654,7 @@ default ResponseEntity testQueryParameterCollectionFormat( value = FakeApi.PATH_TEST_WITH_RESULT_EXAMPLE, produces = { "application/json" } ) - default ResponseEntity testWithResultExample( + default @Valid ResponseEntity testWithResultExample( ) { getRequest().ifPresent(request -> { @@ -701,7 +701,7 @@ default ResponseEntity testWithResultExample( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFileWithRequiredFile( + default @Valid ResponseEntity uploadFileWithRequiredFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 2c42196df109..db171145a3ec 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -70,7 +70,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity testClassname( + default @Valid ResponseEntity testClassname( @Parameter(name = "ClientDto", description = "client model", required = true) @Valid @RequestBody ClientDto clientDto ) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java index 2e38c2031130..0eb3c8912a1a 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java @@ -146,7 +146,7 @@ default ResponseEntity deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByStatus( + default @Valid ResponseEntity> findPetsByStatus( @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) List status ) { getRequest().ifPresent(request -> { @@ -201,7 +201,7 @@ default ResponseEntity> findPetsByStatus( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) - default ResponseEntity> findPetsByTags( + default @Valid ResponseEntity> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) Set tags ) { getRequest().ifPresent(request -> { @@ -255,7 +255,7 @@ default ResponseEntity> findPetsByTags( value = PetApi.PATH_GET_PET_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getPetById( + default @Valid ResponseEntity getPetById( @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId ) { getRequest().ifPresent(request -> { @@ -383,7 +383,7 @@ default ResponseEntity updatePetWithForm( produces = { "application/json" }, consumes = { "multipart/form-data" } ) - default ResponseEntity uploadFile( + default @Valid ResponseEntity uploadFile( @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java index a7837caa0b38..a832ec7d38fd 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java @@ -100,7 +100,7 @@ default ResponseEntity deleteOrder( value = StoreApi.PATH_GET_INVENTORY, produces = { "application/json" } ) - default ResponseEntity> getInventory( + default @Valid ResponseEntity> getInventory( ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -137,7 +137,7 @@ default ResponseEntity> getInventory( value = StoreApi.PATH_GET_ORDER_BY_ID, produces = { "application/xml", "application/json" } ) - default ResponseEntity getOrderById( + default @Valid ResponseEntity getOrderById( @Min(value = 1L) @Max(value = 5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("order_id") Long orderId ) { getRequest().ifPresent(request -> { @@ -187,7 +187,7 @@ default ResponseEntity getOrderById( produces = { "application/xml", "application/json" }, consumes = { "application/json" } ) - default ResponseEntity placeOrder( + default @Valid ResponseEntity placeOrder( @Parameter(name = "OrderDto", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody OrderDto orderDto ) { getRequest().ifPresent(request -> { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java index 91bb84a08ab7..c5d542126a9b 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java @@ -193,7 +193,7 @@ default ResponseEntity deleteUser( value = UserApi.PATH_GET_USER_BY_NAME, produces = { "application/xml", "application/json" } ) - default ResponseEntity getUserByName( + default @Valid ResponseEntity getUserByName( @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username ) { getRequest().ifPresent(request -> { @@ -243,7 +243,7 @@ default ResponseEntity getUserByName( value = UserApi.PATH_LOGIN_USER, produces = { "application/xml", "application/json" } ) - default ResponseEntity loginUser( + default @Valid ResponseEntity loginUser( @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password ) { From ea3ba18151054d3420a0b9fd3140f526b07b7014 Mon Sep 17 00:00:00 2001 From: Leos Bitto Date: Sun, 11 Oct 2026 12:18:09 +0200 Subject: [PATCH 3/4] avoid @Valid in Flux<@Valid SomeType> --- .../resources/JavaSpring/responseType.mustache | 2 +- .../codegen/java/spring/SpringCodegenTest.java | 15 ++++++++------- .../main/java/org/openapitools/api/PetApi.java | 4 ++-- .../main/java/org/openapitools/api/PetApi.java | 4 ++-- .../java/org/openapitools/api/PetApiDelegate.java | 4 ++-- .../main/java/org/openapitools/api/PetApi.java | 4 ++-- .../java/org/openapitools/api/PetApiDelegate.java | 4 ++-- 7 files changed, 19 insertions(+), 18 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/responseType.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/responseType.mustache index 3a870655d094..be8acfa60668 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/responseType.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/responseType.mustache @@ -1 +1 @@ -{{#useBeanValidation}}{{^isVoid}}@Valid {{/isVoid}}{{/useBeanValidation}}{{^vendorExtensions.x-sse}}{{#reactive}}{{#useResponseEntity}}{{#vendorExtensions.x-reactive-return-except-list-of-string}}MonoreturnTypes}}>>>{{/vendorExtensions.x-reactive-return-except-list-of-string}}{{^vendorExtensions.x-reactive-return-except-list-of-string}}MonovalidatedReturnType}}>{{/isArray}}{{^isArray}}{{>returnTypes}}{{/isArray}}>>{{/vendorExtensions.x-reactive-return-except-list-of-string}}{{/useResponseEntity}}{{^useResponseEntity}}{{#vendorExtensions.x-reactive-return-except-list-of-string}}Mono<{{{returnContainer}}}<{{>returnTypes}}>>{{/vendorExtensions.x-reactive-return-except-list-of-string}}{{^vendorExtensions.x-reactive-return-except-list-of-string}}{{#isArray}}Flux{{/isArray}}{{^isArray}}Mono{{/isArray}}<{{#isArray}}{{>validatedReturnType}}{{/isArray}}{{^isArray}}{{>returnTypes}}{{/isArray}}>{{/vendorExtensions.x-reactive-return-except-list-of-string}}{{/useResponseEntity}}{{/reactive}}{{^reactive}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}{{#useResponseEntity}}ResponseEntity<{{/useResponseEntity}}{{>returnTypes}}{{#useResponseEntity}}>{{/useResponseEntity}}{{#responseWrapper}}>{{/responseWrapper}}{{/reactive}}{{/vendorExtensions.x-sse}}{{#vendorExtensions.x-sse}}{{#vendorExtensions.x-reactive-return-except-list-of-string}}{{{returnContainer}}}<{{>returnTypes}}>{{/vendorExtensions.x-reactive-return-except-list-of-string}}{{^vendorExtensions.x-reactive-return-except-list-of-string}}{{#isArray}}Flux{{/isArray}}{{^isArray}}Mono{{/isArray}}<{{#isArray}}{{>validatedReturnType}}{{/isArray}}{{^isArray}}{{>returnTypes}}{{/isArray}}>{{/vendorExtensions.x-reactive-return-except-list-of-string}}{{/vendorExtensions.x-sse}} \ No newline at end of file +{{#useBeanValidation}}{{^isVoid}}@Valid {{/isVoid}}{{/useBeanValidation}}{{^vendorExtensions.x-sse}}{{#reactive}}{{#useResponseEntity}}{{#vendorExtensions.x-reactive-return-except-list-of-string}}MonoreturnTypes}}>>>{{/vendorExtensions.x-reactive-return-except-list-of-string}}{{^vendorExtensions.x-reactive-return-except-list-of-string}}MonoreturnTypes}}{{#isArray}}>{{/isArray}}>>{{/vendorExtensions.x-reactive-return-except-list-of-string}}{{/useResponseEntity}}{{^useResponseEntity}}{{#vendorExtensions.x-reactive-return-except-list-of-string}}Mono<{{{returnContainer}}}<{{>returnTypes}}>>{{/vendorExtensions.x-reactive-return-except-list-of-string}}{{^vendorExtensions.x-reactive-return-except-list-of-string}}{{#isArray}}Flux{{/isArray}}{{^isArray}}Mono{{/isArray}}<{{>returnTypes}}>{{/vendorExtensions.x-reactive-return-except-list-of-string}}{{/useResponseEntity}}{{/reactive}}{{^reactive}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}{{#useResponseEntity}}ResponseEntity<{{/useResponseEntity}}{{>returnTypes}}{{#useResponseEntity}}>{{/useResponseEntity}}{{#responseWrapper}}>{{/responseWrapper}}{{/reactive}}{{/vendorExtensions.x-sse}}{{#vendorExtensions.x-sse}}{{#vendorExtensions.x-reactive-return-except-list-of-string}}{{{returnContainer}}}<{{>returnTypes}}>{{/vendorExtensions.x-reactive-return-except-list-of-string}}{{^vendorExtensions.x-reactive-return-except-list-of-string}}{{#isArray}}Flux{{/isArray}}{{^isArray}}Mono{{/isArray}}<{{>returnTypes}}>{{/vendorExtensions.x-reactive-return-except-list-of-string}}{{/vendorExtensions.x-sse}} \ 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 a8584abbb994..06872bed384e 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 @@ -1969,7 +1969,7 @@ public void reactiveArrayShouldBeWrappedInFluxWithoutMono() throws IOException { .assertThat(files.get("PetApi.java")) .assertMethod("addPet").hasReturnType("Mono") .toFileAssert() - .assertMethod("findPetsByStatus").hasReturnType("Flux<@Valid Pet>") + .assertMethod("findPetsByStatus").hasReturnType("Flux") .toFileAssert() .assertMethod("deletePet").hasReturnType("Mono"); } @@ -1991,7 +1991,7 @@ public void reactiveArrayShouldBeWrappedInMonoFluxWhenUsingResponseEntity() thro .assertThat(files.get("PetApi.java")) .assertMethod("addPet").hasReturnType("Mono>") .toFileAssert() - .assertMethod("findPetsByStatus").hasReturnType("Mono>>") + .assertMethod("findPetsByStatus").hasReturnType("Mono>>") .toFileAssert() .assertMethod("deletePet").hasReturnType("Mono>"); } @@ -3492,8 +3492,8 @@ public void validatesNonVoidReturnsAndObjectCollectionElements(boolean validatio String api = Files.readString(files.get("CollectionApi.java").toPath()); String model = mappedModel ? "com.example.ExternalPet" : "Pet"; String element = validation ? (mappedModel ? "com.example.@Valid ExternalPet" : "@Valid Pet") : model; - String list = reactive ? "Flux<" + element + ">" : "List<" + element + ">"; - String set = reactive ? "Flux<" + element + ">" : "Set<" + element + ">"; + String list = reactive ? "Flux<" + model + ">" : "List<" + element + ">"; + String set = reactive ? "Flux<" + model + ">" : "Set<" + element + ">"; String map = "Map"; String strings = "List"; String integers = reactive ? "Flux" : "List"; @@ -3530,7 +3530,8 @@ public void validatesNonVoidReturnsAndObjectCollectionElements(boolean validatio annotation + pet + " getPet(", annotation + integers + " getNumbers(", annotation + stringMap + " getNamesById(", annotation + name + " getName(", "default " + noContent + " getNothing(") - .doesNotContain("ResponseEntity<@Valid", "Mono<@Valid", "List<@Valid String", "Flux<@Valid Integer", + .doesNotContain("ResponseEntity<@Valid", "Mono<@Valid", "List<@Valid String", "Flux<@Valid", + "Flux") + .hasReturnType("Flux") .toFileAssert() .assertMethod("nonSSE", "ServerWebExchange") .isNotNull() @@ -5675,7 +5676,7 @@ public void testSSEOperationSupport() throws Exception { .toFileAssert() .assertMethod("sseVariant2", "ServerWebExchange") .isNotNull() - .hasReturnType("Flux<@Valid EventType>") + .hasReturnType("Flux") .bodyContainsLines("return Flux.empty();") .toFileAssert() .assertMethod("nonSSE", "ServerWebExchange") diff --git a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/PetApi.java index 7c21e1822a44..5c83b7c9e7dc 100644 --- a/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-http-interface-reactive-bean-validation/src/main/java/org/openapitools/api/PetApi.java @@ -86,7 +86,7 @@ Mono> deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, accept = { "application/json", "application/xml" } ) - @Valid Mono>> findPetsByStatus( + @Valid Mono>> findPetsByStatus( @NotNull @RequestParam(value = "status", required = true) List status ); @@ -107,7 +107,7 @@ Mono> deletePet( value = PetApi.PATH_FIND_PETS_BY_TAGS, accept = { "application/json", "application/xml" } ) - @Valid Mono>> findPetsByTags( + @Valid Mono>> findPetsByTags( @NotNull @RequestParam(value = "tags", required = true) Set tags ); 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 79184358ecdc..8fca23254804 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 @@ -146,7 +146,7 @@ default Mono deletePet( produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) - default @Valid Flux<@Valid Pet> findPetsByStatus( + default @Valid Flux findPetsByStatus( @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) List status ) { return getDelegate().findPetsByStatus(status); @@ -187,7 +187,7 @@ default Mono deletePet( produces = { "application/xml", "application/json" } ) @ResponseStatus(HttpStatus.OK) - default @Valid Flux<@Valid Pet> findPetsByTags( + default @Valid Flux findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) Set tags ) { return getDelegate().findPetsByTags(tags); 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 517130635a10..79cdb67b0e72 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 @@ -75,7 +75,7 @@ default Mono deletePet(Long petId, * or Invalid status value (status code 400) * @see PetApi#findPetsByStatus */ - default @Valid Flux<@Valid Pet> findPetsByStatus(List status) { + default @Valid Flux findPetsByStatus(List status) { Mono result = Mono.empty(); @@ -94,7 +94,7 @@ default Mono deletePet(Long petId, * @see PetApi#findPetsByTags */ @Deprecated - default @Valid Flux<@Valid Pet> findPetsByTags(Set tags) { + default @Valid Flux findPetsByTags(Set tags) { 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 d2125e5f2366..3d1ced538b75 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 @@ -146,7 +146,7 @@ default Mono> deletePet( value = PetApi.PATH_FIND_PETS_BY_STATUS, produces = { "application/xml", "application/json" } ) - default @Valid Mono>> findPetsByStatus( + default @Valid Mono>> findPetsByStatus( @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @RequestParam(value = "status", required = true) List status, @Parameter(hidden = true) final ServerWebExchange exchange ) { @@ -187,7 +187,7 @@ default Mono> deletePet( value = PetApi.PATH_FIND_PETS_BY_TAGS, produces = { "application/xml", "application/json" } ) - default @Valid Mono>> findPetsByTags( + default @Valid Mono>> findPetsByTags( @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @RequestParam(value = "tags", required = true) Set tags, @Parameter(hidden = true) final ServerWebExchange 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 0f7472bf62d4..fbb5afd906a4 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 @@ -83,7 +83,7 @@ default Mono> deletePet(Long petId, * or Invalid status value (status code 400) * @see PetApi#findPetsByStatus */ - default @Valid Mono>> findPetsByStatus(List status, + default @Valid Mono>> findPetsByStatus(List status, ServerWebExchange exchange) { Mono result = Mono.empty(); @@ -118,7 +118,7 @@ default Mono> deletePet(Long petId, * @see PetApi#findPetsByTags */ @Deprecated - default @Valid Mono>> findPetsByTags(Set tags, + default @Valid Mono>> findPetsByTags(Set tags, ServerWebExchange exchange) { Mono result = Mono.empty(); From d8640af22870d7536bac02048e58e2129e470021 Mon Sep 17 00:00:00 2001 From: Leos Bitto Date: Tue, 13 Oct 2026 22:12:54 +0200 Subject: [PATCH 4/4] generated samples --- .../src/main/java/org/openapitools/api/AccountsApi.java | 2 +- .../src/main/java/org/openapitools/api/CountersApi.java | 2 +- .../src/main/java/org/openapitools/api/PetsApi.java | 4 ++-- .../src/main/java/org/openapitools/api/ShapesApi.java | 2 +- .../src/main/java/org/openapitools/api/VehiclesApi.java | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/samples/openapi3/server/petstore/spring-boot-records/src/main/java/org/openapitools/api/AccountsApi.java b/samples/openapi3/server/petstore/spring-boot-records/src/main/java/org/openapitools/api/AccountsApi.java index af51d434c955..55b8fdef726e 100644 --- a/samples/openapi3/server/petstore/spring-boot-records/src/main/java/org/openapitools/api/AccountsApi.java +++ b/samples/openapi3/server/petstore/spring-boot-records/src/main/java/org/openapitools/api/AccountsApi.java @@ -63,7 +63,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity addAccount( + default @Valid ResponseEntity addAccount( @Parameter(name = "Account", description = "", required = true) @Valid @RequestBody Account account ) { getRequest().ifPresent(request -> { diff --git a/samples/openapi3/server/petstore/spring-boot-records/src/main/java/org/openapitools/api/CountersApi.java b/samples/openapi3/server/petstore/spring-boot-records/src/main/java/org/openapitools/api/CountersApi.java index 39f5be0275b4..65384c92071a 100644 --- a/samples/openapi3/server/petstore/spring-boot-records/src/main/java/org/openapitools/api/CountersApi.java +++ b/samples/openapi3/server/petstore/spring-boot-records/src/main/java/org/openapitools/api/CountersApi.java @@ -63,7 +63,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity addCounters( + default @Valid ResponseEntity addCounters( @Parameter(name = "Counters", description = "", required = true) @Valid @RequestBody Counters counters ) { getRequest().ifPresent(request -> { diff --git a/samples/openapi3/server/petstore/spring-boot-records/src/main/java/org/openapitools/api/PetsApi.java b/samples/openapi3/server/petstore/spring-boot-records/src/main/java/org/openapitools/api/PetsApi.java index a2b81363a4f0..16fafca4abae 100644 --- a/samples/openapi3/server/petstore/spring-boot-records/src/main/java/org/openapitools/api/PetsApi.java +++ b/samples/openapi3/server/petstore/spring-boot-records/src/main/java/org/openapitools/api/PetsApi.java @@ -65,7 +65,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity addPet( + default @Valid ResponseEntity addPet( @Parameter(name = "Pet", description = "", required = true) @Valid @RequestBody Pet pet ) { getRequest().ifPresent(request -> { @@ -102,7 +102,7 @@ default ResponseEntity addPet( value = PetsApi.PATH_SEARCH_PETS, produces = { "application/json" } ) - default ResponseEntity> searchPets( + default @Valid ResponseEntity> searchPets( @Parameter(name = "filter", description = "", in = ParameterIn.QUERY) @Valid @Nullable Filter filter ) { getRequest().ifPresent(request -> { diff --git a/samples/openapi3/server/petstore/spring-boot-records/src/main/java/org/openapitools/api/ShapesApi.java b/samples/openapi3/server/petstore/spring-boot-records/src/main/java/org/openapitools/api/ShapesApi.java index f53b45f26943..0ddc8779b22b 100644 --- a/samples/openapi3/server/petstore/spring-boot-records/src/main/java/org/openapitools/api/ShapesApi.java +++ b/samples/openapi3/server/petstore/spring-boot-records/src/main/java/org/openapitools/api/ShapesApi.java @@ -63,7 +63,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity addShape( + default @Valid ResponseEntity addShape( @Parameter(name = "Shape", description = "", required = true) @Valid @RequestBody Shape shape ) { getRequest().ifPresent(request -> { diff --git a/samples/openapi3/server/petstore/spring-boot-records/src/main/java/org/openapitools/api/VehiclesApi.java b/samples/openapi3/server/petstore/spring-boot-records/src/main/java/org/openapitools/api/VehiclesApi.java index 456e82820908..0f3c485b4161 100644 --- a/samples/openapi3/server/petstore/spring-boot-records/src/main/java/org/openapitools/api/VehiclesApi.java +++ b/samples/openapi3/server/petstore/spring-boot-records/src/main/java/org/openapitools/api/VehiclesApi.java @@ -63,7 +63,7 @@ default Optional getRequest() { produces = { "application/json" }, consumes = { "application/json" } ) - default ResponseEntity addVehicle( + default @Valid ResponseEntity addVehicle( @Parameter(name = "Vehicle", description = "", required = true) @Valid @RequestBody Vehicle vehicle ) { getRequest().ifPresent(request -> {